What is Qt?
❏ Cross-platform application development
❏ Used to create graphical user interfaces.
❏ It can be used with several different
❏ “t” in Qt refers to toolkit which defines Qt
much better. Therefore, it can effectively be
defined as a set of tools.
❏ The main component is a set of libraries, written
natively in C++. These libraries include: the core library
providing the most important stuff, the GUI library
providing the GUI components, the XML library.
❏ Meta Object Compiler(moc) used to handle Qt’s C++
extensions.This extends C++ a little bit, adding nice
features like the signals/slots mechanism
❏ The GUI designer tool and the UIC. Qt Designer is a
graphical tool to create GUIs visually and save them to
XML files, and the UIC is a command-line tool to
translate those XML files to C++ code.
❏ Qt Linguist, tool to internationalize
applications.Qt Linguist is a graphical tool for
translator to edit those XML files and provide
❏ The qmake tool, used to automate build
process, so you don't have to run MOC, C++
compiler, UIC and other things manually.
❏ The Qt Creator, a graphical IDE to integrate
all the stuff described above into a single
Similarly a 2D graphic
such as a circle,ellipse
can be built
The code uses QPainter on QMainWindow. Circle
drawing is done during gui decoration process , it is
not drawn as an animation.Drawing empty circle on
QMainWindow involves subclassing of
QMainWindow and overriding
❏ Coin3D is a high level 3D graphics toolkit for
developing cross-platform 3D visualizations.
❏ It uses scene graph data structures to render
❏ Based on the de facto standard Open
Inventor, Coin3D is a set of libraries for
creating 3D graphics applications.
1. Download Coin-3.1.3.tar.gz fom
2. Next unzip the file using the following commands:
o cd /tmp
o gzip -cd Coin-3.1.3.tar.gz | tar xvf -
o mkdir coin-build
3. Run configure from the build directory:cd coin-build
5. Build the Coin library:
7. Install the Coin library:
8. make install
SoQt is a library which provides bridge
between Coin3D visualistion and Qt
2D Graphical Interface.
Add in the pro file:
LIBS += -lCoin3D -lSoQt
Open Inventor is a “scenegraph“ graphics API:
All visible objects are stored in a scenegraph
Capabilities of Open Inventor
❏ Easy construction of 3D scenes
❏ User interaction
There are three kinds of nodes:
Group nodes: allow construction of trees
Property nodes: change the color / location /
... of the next object
Shapes: visible objects.
#include <Inventor/Qt/SoQt.h>: The SoQt class takes
care of Qt initialisation.
It is the general purpose viewer to view the 3D object
It is subclass of SoGroup class.
This is the node for cube shape. It comes under the
category of shape nodes.
❏ QWidget * mainwin = SoQt::init(argc, argv, argv);
SoQt ::init with a string creates a QApplication and its
main window, and returns its window handle.
❏ SoSeparator * root = new SoSeparator;
The root node of the scene graph is created here.
❏ SoCube *cube = new SoCube;
A cube is added to the scene as a child to the root node.
The ExaminerViewer class of the viewer is used for
display of objects.
This pops up the main window.
Cleans up all static data allocated by the SoQt library on