Question

I'm Working on a small project and i need to work with OpenGL + QT

I'm Newbie in both of them. So i need a good tutorial that illustrates how to work with them each other not individually

is it better to work OpenGL on QT Creator or use QT Visual Studio Plug-in?

Was it helpful?

Solution

You'll be using QGLWidget a lot! Here you go:

http://doc.qt.io/qt-5/examples-widgets-opengl.html

Of all those, maybe this is the best one to start: Hello GL Example. If you prefer using Qt Quick instead of Qt Widgets, check these posts:

If you want a higher-level 3D API than OpenGL, as o Qt 5.7 Qt 3D became stable.

As for the IDE I suggest using Qt Creator. It works out of the box on Windows and the syntax highlighting and autocomplete are comparable to Visual Studio.

OTHER TIPS

You have several different options for using OpenGL in Qt. It has changed a lot over the years. For an introduction that should cover all the basic info you need to start look at this post. The old style Qt OpenGL classes and functions were called QGLxx but are now called QOpenGLxx and have been moved to the QtGUI module to start with.

Many of the simple OpenGL examples with Qt (including the QOpenGLWindow example shipped with Qt) use the old style of OpenGL that shouldn't be used any longer. Here is a tutorial that has updated the QOpenGLWindow example to modern OpenGL (3+). It is the simplest, most up to date example I have come across.

I second Qt Creator, especially for learning. It has much better integration with the Qt help files than Visual Studio does. If you are considering switching between IDEs I would also recommend building with CMake. CMake is very similar to the built in qmake of Qt Creator but it can work just as good with Visual Studio or other IDEs. I have been running some examples for learning purposes in both Visual Studio and Qt Creator with CMake. Here is a simple CMake example with Qt. For my purposes I still use the Visual Studio compiler when working in Qt Creator though.

There're some examples of how to use Open GL with QT in the SDK. You can open these examples in QT Creator if you want. To answer the second question, I find QT Creator much faster and more pleasant to use than Visual Studio but YMMV.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top