QCustomPlot Discussion and Comments

OpenGL SupportReturn to overview

I have read the performance tweaking tips and i am little confused.

It says that :
"On all operating systems, use OpenGL hardware acceleration by supplying "-graphicssystem opengl" as command line argument or calling QApplication::setGraphicsSystem("opengl") (Only available for Qt versions before 5.0)."

So, isn't it possible to use OpenGL after Qt 5.0 ? If it is, how it is possible ?

By the way, i have no knowledge in OpenGL. I have lots of data and i need real time plotting, so, i 'm in need of really high performance.

It might be possible in Qt5 by placing QCustomPlot inside a QGLWidget. I Haven't tested that though, and since QCP draws into an off-screen buffer QPixmap first, it might not work as intended. It's truly a shame that the Qt devs have removed such a valuable feature as QApplication::setGraphicsSystem.

It can be done by building entire Qt from sourcecode with an option "-opengl desktop".
You can read more here: http://qt-project.org/wiki/MinGW-64-bit

Has anyone tried this and say how much it speeds things up? I'm looking for ways to speed-up graphing of 30K points. Right now, copying data int the QCPDataMap takes 6msec and doing the plot takes 80msec. So, I'm assuming no hardware acceleration is being used right now. Our device has a 1.86GHz Celeron M 440 processor.

Ben

For QT 5.0 w/OpenGL, do I just ahve to add "QT += opengl" to the .pro file and things should accelerate?

A problem I have here is our target system only supports OpenGL v1.4. Does anyone know the minimum for QCustomPlot?

To answer part of my own question here, QCustomPlot uses QPainter which requires OpenGL 2.0. If anyone has successfully run it using a lower version of OpenGL, please let me know. It looks like we really are going to need hardware acceleration.

Does QCustomPlot run on the OpenGL ES 2.0 subset? If so, I think we can use ANGLE since our target has DirectX 9.0.

The answer was to use Qt 4.8.5 and enter "-graphicssystem opengl" as an argument in the Run Settings under Projects. At least, this worked with my desktop machine which has OpenGl 2.1 - I got OpenGL errors on my 1.4 target. I could never trigger an OpenGL benefit out of Qt5.

It will be really good it QCustomPlot can be someday modified for Qt5, and do everything within the confines of OpenGL ES 2.0 so that people with Windows can download the ANGLE version of QT and get hardware acceleration. Another good feature (at least for fast oscilloscope type plots) would be to let it take an array of longs. Just transferring this to the double QMap takes a lot of time.

The thing is, QCustomPlot can run OpenGL via the QPainter interface. It works great in Qt4. It's just that the Qt developers have decided to remove OpenGL support in Qt5(*). Unfortunately there's nothing I can do about it (except rewrite QCP with QML to fit into Qt's dreams about being the king of telephone software ;)

(*) At least I'm not aware of a QPainter backend that works with OpenGL ES2.0 under Qt5.

If you put QCustomPlot inside (as child of) a QGLWidget, you get accelerated drawing in Qt5. Also see http://stackoverflow.com/questions/6493099/qt-rendering-using-opengl