0% found this document useful (0 votes)
50 views7 pages

Introduction To QT

Qt is a framework for building graphical user interfaces that allows developers to create applications for multiple desktop and mobile platforms. It features a powerful object model with signal and slot functionality for communication between objects. Qt uses an event-driven approach and includes timers, translation capabilities, and object hierarchies. Projects can be built with Qt using QMake or CMake build systems which handle preprocessing of the meta-object compiler.

Uploaded by

mkreddy477
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views7 pages

Introduction To QT

Qt is a framework for building graphical user interfaces that allows developers to create applications for multiple desktop and mobile platforms. It features a powerful object model with signal and slot functionality for communication between objects. Qt uses an event-driven approach and includes timers, translation capabilities, and object hierarchies. Projects can be built with Qt using QMake or CMake build systems which handle preprocessing of the meta-object compiler.

Uploaded by

mkreddy477
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Introduction to Qt

● Create powerful Graphics User Interfaces (GUI)


● Multi-platform : Windows, MacOs, Linux,
Symbian, Android…
● Complete framework : 2D and 3D graphics,
network, XML, SQL, …
● Widely used : Autodesk Maya, Adobe Photoshop
Elements, Skype, VLC Media Player, VirtualBox,
Mathematica, KDE…
The Qt Object Model
● a very powerful mechanism for seamless object communication called signals
and slots
● queryable and designable object properties
● powerful events and event filters
● contextual string translation for internationalization
● sophisticated interval driven timers that make it possible to elegantly integrate
many tasks in an event-driven GUI
● hierarchical and queryable object trees that organize object ownership in a
natural way
● guarded pointers (QPointer) that are automatically set to 0 when the
referenced object is destroyed, unlike normal C++ pointers which become
dangling pointers when their objects are destroyed
● a dynamic cast that works across library boundaries.
Signal and Slots
http://qt-project.org/doc/qt-5.1/qtcore/signalsandslots.html

● Event-driven control
● Signals and slots are functions
with (matching) parameters

An object which emits a signal
neither knows nor cares which
slots (possibly many) receive
the signal
● a slot does not know if it has
any signals (possibly many)
connected to it
Simple example
● C++ counter class

● Qt counter
– Derives from QObject
– Code will be pre-
processed by Meta-
Object Compiler
(MOC)
Simple example (continued)
● Slot implementation

● Example of use
Building a Qt project

● Q_OBJECTs require a
MOC pass
● Widget descriptions (.ui)
require the generation
of .h and .cpp files
● Resources (.qrc) are
translated to .cpp

http://qt-quarterly.developpez.com/qq-34/cmake/

● QMake makes this


automatically
● Possible with CMake too
References
● Qt Documentation
– http://qt-project.org/doc/
– http://qt-project.org/doc/qt-4.8/how-to-learn-qt.html

● Other sources
– Nice tutorial :
http://fr.openclassrooms.com/informatique/cours/program

You might also like