Reputation: 22084
I'm a bit unsure about compiling QT 5.2.1 without OpenGL support. I always thought that OpenGL would be needed for application which wish to do graphics, but when I read the documentation there is talk about 2D on Desktop functionality as well. If I don't plan to use any graphics and just want to make use of the windowing framework of QT, do I still need that desktop suport? Somehow this wouldn't make sense to allow it as an optional component it were required but I don't really know if it is required anyway, because I don't know what this support would be used for.
So the primary question is, if I just want to implement a regular desktop application which uses windows and widgets, I don't need to compile with OpenGL support, right?
I have used wxWidgets as my cross platform library so far, and never needed to touch OpenGL, so I would use QT in the same way.
Upvotes: 2
Views: 1077
Reputation: 32894
if I just want to implement a regular desktop application which uses windows and widgets, I don't need to compile with OpenGL support, right?
I think the answer is yes; although at the app level, like this thread specifically calls out, from Qt 5 onwards setting the graphic subsystem to raster -graphicssystem raster
is deprecated, you can set the window's surface type to RasterSurface
, which allows rendering using raster without OpenGL support using QBackingStore
(a non-OpenGL drawing context); its API doc confirms this. QWindow
's documentation also briefs this.
If I don't plan to use any graphics and just want to make use of the windowing framework of QT, do I still need that desktop suport?
Yes, if you need QML and Qt5's QtQuick 2 render or QtGui which exclusively use OpenGL and is a core part of the Qt's graphics system. No, if you can do it without any of those. This Qt 5 Raster Window sample does exactly that; you can notice that the project file has no mention of OpenGL in it.
Upvotes: 1
Reputation: 11754
The answer is: it's complicated. QtCore
will run perfectly happily without the OpenGL dependency, however with Qt5 they moved the widget system heavily towards using OpenGL(ES) for performance reasons. It's a bit difficult to find an answer on this through the Qt documentation, however if you just want to build a Qt5 application with QtWidgets
you can specify no OpenGL on the configure statement and you'll be fine. If you wish to use QML
then you need the OpenGL dependency to get it work, but the QtWidget
system is now effectively done so it won't be improved any time soon.
Upvotes: 1
Reputation: 295
The OpenGL module is needed only if you want to use glWidget, for classical desktop application you don't need it.
Upvotes: 0