Qt OpenGL Widget as a view port for qcustomPlot
Unsolved
Mobile and Embedded
-
I'm working on project to plot the data from file. I use Qt5.4 and qcustomPlot library to plot the data as X,Y graph, as known the Qt5 don't support OpenGL. I google this problem and found this code:
QDeclarativeView mainwindow; mainwindow.setSource(QUrl::fromLocalFile("./qml/app.qml")); QGLFormat format = QGLFormat(QGL::DirectRendering); // you can play with other rendering formats like DoubleBuffer or SimpleBuffer format.setSampleBuffers(false); QGLWidget *glWidget = new QGLWidget(format); glWidget->setAutoFillBackground(false); mainwindow.setViewport(glWidget);
from this thread
but I'm new in Qt and C++ and do not know how to implment this code in my program. the source code of my program on GitHub in this link
please help me -
Hi,
Qt has support for OpenGL since way before Qt 5.
Changing the viewport is only available to a small subset of class which doesn't include QMainWindow.
-
I don't suggest anything since I don't know what you are trying to plot and why you would need OpenGL as a viewport for it.
-
Because it's not part of Qt 5.6, you have to compile it by hand.