OpenGL using Qt 5.2.1
-
wrote on 7 Dec 2015, 14:49 last edited by
Hi, I would like to use Qt for a course on OpenGL I'll be supervising early next year. The thing is, the version of Qt installed on the machines that we can use is 5.2.1. What would be the recommended workflow here, using a QWindow with QOpenGLContext? In 5.4+ I'd use a QOpenGLWindow or QOpenGLWidget.
-
Hi
Updating to 5.4+ is not an option?
Lesson 1:
Using the qt maintenance tool. :) -
wrote on 7 Dec 2015, 22:35 last edited by
Well, I don't have the rights to update those machines (all running Ubuntu 14.04 LTS). It looks like I'll have to rely on using 5.2.1
-
Well, I don't have the rights to update those machines (all running Ubuntu 14.04 LTS). It looks like I'll have to rely on using 5.2.1
@Ailurus said:
ok. it's a shame as QOpenGLWindow is somewhat more modern or
at least it felt so.
How many machines are there?
Huge work I assume and the admins will run away screaming if you ask
for upgrade? -
Hi,
One alternative that you can propose to your IT service is use the online installer, no need for root rights to use that version of Qt and you'll have a modern setup to teach OpenGL.
-
wrote on 7 Dec 2015, 22:50 last edited by Ailurus 12 Jul 2015, 22:52
Thanks both. There are 20-30 computers. Requesting updates that require packages from the standard Ubuntu 14.04 repositories is usually not a problem. It gets a bit trickier when a manual approach has to be used though :).
Judging by your replies there doesn't seem to be a straightforward approach to use OpenGL with Qt 5.2.1 (without falling back on QGL* libraries)?
-
OpenGL and Qt dates back way before Qt 5. It's just that "modern OpenGL" is a bit more recent and Qt 5.2.1 doesn't have yet everything it has now.
-
Thanks both. There are 20-30 computers. Requesting updates that require packages from the standard Ubuntu 14.04 repositories is usually not a problem. It gets a bit trickier when a manual approach has to be used though :).
Judging by your replies there doesn't seem to be a straightforward approach to use OpenGL with Qt 5.2.1 (without falling back on QGL* libraries)?
hi
You could read these 5 articles
http://www.kdab.com/opengl-in-qt-5-1-part-1/
They give good info on what is available in my opinion. -
wrote on 7 Dec 2015, 23:28 last edited by
Very nice example using the various shader stages! However, it seems to come down to either using something like QGLWidget or updating to 5.4+. Correct?
-
Although QOpenGLWindow and QOpenGLWidget are nice Qt5.4 convenience classes, you can still use a vanilla QWindow to render OpenGL. It is available starting with Qt5.0.
It's a little more code to start but after that it's straightforward. The OpenGL Window Example shows how to use it.Still, updating to more recent Qt version is a preferred thing to do. There's no reason to teach people things that are outdated from the get go. The unnecessary boilerplate code will obscure the topic.
1/10