01 - QT Essentials - Fundamentals of QT Module
01 - QT Essentials - Fundamentals of QT Module
Training Course
Visit us at http://qt.digia.com
Produced by Digia Plc.
Material based on Qt 5.0, created on September 27, 2012
Digia Plc.
Module: Fundamentals of Qt
The Story of Qt
Developing a Hello World Application
Hello World using Qt Creator
Practical Tips for Developers
2/31
Fundamentals of Qt
3/31
Fundamentals of Qt
Module: Fundamentals of Qt
The Story of Qt
Developing a Hello World Application
Hello World using Qt Creator
Practical Tips for Developers
The Story of Qt
4/31
Fundamentals of Qt
Meet Qt
Qt Development Frameworks founded in 1994
See
Qt Services
.
The Story of Qt
5/31
Fundamentals of Qt
Qt is used everywhere
The Story of Qt
6/31
Fundamentals of Qt
.See Qt Licensing
The Story of Qt
7/31
Fundamentals of Qt
Why Qt
Write code once to target multiple platforms
Produce compact, high-performance applications
Focus on innovation, not infrastructure coding
Choose the license that ts you
Commercial, LGPL or GPL
.
.15 years of customer success and community growth
The Story of Qt
8/31
Fundamentals of Qt
Why Qt Commercial
Improved development tools for increased productivity and tangible
cost savings
Qt Commercial SDK
All Qt Commercial libraries and tools
Additional tools and components
The Story of Qt
9/31
Fundamentals of Qt
Qt5
Awesome graphics capabilities
OpenGL as a standard feature of user interfaces
Shader-based graphics effects in QtQuick 2
JSON DB
Cross-platform portability
Qt Platform Abstraction (QPA) replaces QWS and platform ports
The Story of Qt
10/31
Fundamentals of Qt
Qt5 Modules
The Story of Qt
11/31
Fundamentals of Qt
Qt5 Highlights
QtCore
QtGui
QtQuick 2
The Story of Qt
12/31
Fundamentals of Qt
Qt Demo
Let's have a look at the QtDemo Application
Comes with every Qt installation
Technology
Painting
Widgets
Widgets
Graphics View
OpenGL
WebKit
The Story of Qt
Demo
Demonstrations/Path Stroking
Demonstrations/Books
Demonstrations/TextEdit
Demonstrations/40.000 Chips
Demonstrations/Boxes
Demonstrations/Browser
13/31
Fundamentals of Qt
Module: Fundamentals of Qt
The Story of Qt
Developing a Hello World Application
Hello World using Qt Creator
Practical Tips for Developers
14/31
Fundamentals of Qt
``Hello World'' in Qt
// main.cpp
#include <QtWidgets>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton button("Hello world");
button.show();
return app.exec();
}
Program consists of
main.cpp - application code
helloworld.pro - project le
.Demo fundamentals/ex-helloworld
15/31
Fundamentals of Qt
= main.cpp
HEADERS +=
QT
# No headers used
Assignment to variables
Possible operators =, +=, -=
.See qmake tutorial Documentation
16/31
Fundamentals of Qt
Using qmake
qmake tool
Creates cross-platform make-les
./helloworld
# executes application
17/31
Fundamentals of Qt
Module: Fundamentals of Qt
The Story of Qt
Developing a Hello World Application
Hello World using Qt Creator
Practical Tips for Developers
18/31
Fundamentals of Qt
QtCreator IDE
Advanced C++ code editor
Integrated GUI layout and forms designer
Project and build management tools
Integrated, context-sensitive help system
Visual debugger
Rapid code navigation tools
Supports
multiple
platforms
19/31
Fundamentals of Qt
20/31
Fundamentals of Qt
Locator Prexes
: <class name> - Go to a symbol denition
l <line number> - Go to a line in the current document
? <help topic> - Go to a help topic
o <open document> - Go to an opened document
21/31
Fundamentals of Qt
Debugging an Application
Debug > Start Debugging (or F5)
22/31
Fundamentals of Qt
23/31
Fundamentals of Qt
Module: Fundamentals of Qt
The Story of Qt
Developing a Hello World Application
Hello World using Qt Creator
Practical Tips for Developers
24/31
Fundamentals of Qt
Polymorphism
That is virtual methods
Operator overloading
Templates
For the container classes only
No ...
... RTTI
... sophisticated templates
... exceptions thrown
...
25/31
Fundamentals of Qt
Qt Documentation
Reference Documentation
All classes documented
Contains tons of examples
26/31
Fundamentals of Qt
Online communities
http://qt-project.org/wiki/OnlineCommunities
.
Use the source!
.
Qt's source code is easy to read, and can answer questions the reference
manual
cannot answer!
.
27/31
Fundamentals of Qt
28/31
Fundamentals of Qt
Class includes
#include <QLabel>
29/31
Fundamentals of Qt
30/31
Fundamentals of Qt
30/31
Fundamentals of Qt
30/31
Fundamentals of Qt
30/31
Fundamentals of Qt
30/31
Fundamentals of Qt
30/31
Fundamentals of Qt
30/31
Fundamentals of Qt
Digia Plc.
Digia, Qt and the Digia and Qt logos are the registered trademarks of
Digia Plc. in Finland and other countries worldwide.
31/31
Fundamentals of Qt