Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Qt works well with OpenGL. Did you try QGLWidget or QOpenGLWidget?

IIRC the QOpenGLWidget is a low-level class that gives you direct access to the OpenGL routines, while QGLWidget is higher level that can use Qt functions for drawing (still with hardware acceleration).

Here is an example: http://doc.qt.io/qt-5/qtopengl-2dpainting-example.html

To display an OpenCV Mat in Qt, you have to convert it to QImage (BGR->RGB), then to QPixmap. There are several examples how to do this. If you are using OpenGL routines, I think you can display directly a gpuMat image (but I never tried this).