January 2004
Intermediate to advanced
464 pages
9h 59m
English
This chapter shows how to combine basic C++ with the functionality provided by Qt to create a few small graphical user interface (GUI) applications. This chapter also introduces two key Qt ideas: “signals and slots” and layouts. In Chapter 2, we will go into more depth, and in Chapter 3, we will start building a realistic application.
Here’s a very simple Qt program:
1 #include <qapplication.h>
2 #include <qlabel.h>
3 int main(int argc, char *argv[])
4 {
5 QApplication app (argc, argv);
6 QLabel *label = new QLabel("Hello Qt!", 0);
7 app.setMainWidget(label);
8 label->show();
9 return app.exec();
10 }
We will first study it line by line, then we will see ...
Read now
Unlock full access