Qt is one of the most successful cross-platform application and UI frameworks, which can be used under Linux, Windows, Mac OS X, and even mobile systems. So it is more convenient and portable than integrating OSG with X11/Windows window handles. Qt provides a QGLWidget
class that can render OpenGL elements directly on the window surface, and in older versions of the OSG source code, you may find some examples using this class. But for 3.0 and newer versions, OSG 3.0 has an osgQt library for implementing different functionalities related to Qt. We will first make use of the osgQt::GraphicsWindowQt
class in this recipe.
You have to download and compile Qt 4.x before working on the following few examples. Under Ubuntu, you can quickly get the full precompiled packages (including the UI designer tool) using the apt-get
command:
# apt-get install qt4-dev-tools qt4-doc qt4-qtconfig qt4-demos
qt4-designer
For other Linux and Windows developers, visit the...