Documente Academic
Documente Profesional
Documente Cultură
Beginning Qt
CS3249 (SoC,
NUS) (SoC, NUS)
CS3249
Beginning Qt
Beginning Qt
1
1
by examples!
CS3249 (SoC,
NUS) (SoC, NUS)
CS3249
Beginning Qt
Beginning Qt
2
2
Hello, World!
#include <QApplication>
#include <QLabel>
int main(int argv, char **args)
{
QApplication app(argv, args);
QLabel label("<H2>Hello, World!<br><br>\
Welcome to CS3249!</H2>"); // create label
label.show();
return app.exec();
// start running
Beginning Qt
Beginning Qt
3
3
window
title bar
QLabel
widget
CS3249 (SoC,
NUS) (SoC, NUS)
CS3249
Beginning Qt
Beginning Qt
4
4
window
widget
Beginning Qt
Beginning Qt
5
5
<QApplication>
<QHBoxLayout>
<QSlider>
<QSpinBox>
Beginning Qt
Beginning Qt
6
6
CS3249 (SoC,
NUS) (SoC, NUS)
CS3249
// Initialise value.
Beginning Qt
Beginning Qt
7
7
window->show();
return app.exec();
CS3249 (SoC,
NUS) (SoC, NUS)
CS3249
Beginning Qt
Beginning Qt
8
8
Layout
title bar
window
(QWidget)
layout
(QHBoxLayout)
spinbox
(QSpinBox)
slider
(QSlider)
CS3249 (SoC,
NUS) (SoC, NUS)
CS3249
Beginning Qt
Beginning Qt
9
9
valueChanged(35)
setValue(35)
no change
CS3249 (SoC, NUS)
CS3249 (SoC,
NUS) (SoC, NUS)
CS3249
Beginning Qt
Beginning Qt
10
10
Widgets
Display
Button
Input
Container
Item view
Dialog
Beginning Qt
Beginning Qt
11
11
Display Widgets
QLabel
QLCDNumber
QLabel (image)
QProgressBar
QTextBrowser
Beginning Qt
Beginning Qt
12
12
Button Widgets
QPushButton
QToolButton
QCheckBox
QRadioButton
Beginning Qt
Beginning Qt
13
13
Input Widgets
QLineEdit
QDateEdit
QTimeEdit
QDateTimeEdit
QSlider
QScrollBar
QSpinBox
QDoubleSpinBox
CS3249 (SoC, NUS)
Beginning Qt
Beginning Qt
14
14
QComboBox
QFontComboBox
QDial
CS3249 (SoC,
NUS) (SoC, NUS)
CS3249
QTextEdit
Beginning Qt
Beginning Qt
QCalendar
15
15
Container Widgets
QGroupBox
QFrame
QToolBox
QTabWidget
CS3249 (SoC, NUS)
Beginning Qt
Beginning Qt
16
16
QTreeView
QTableView
CS3249 (SoC, NUS)
Beginning Qt
Beginning Qt
17
17
QColorDialog
QFontDialog
QFileDialog
QPrintDialog
CS3249 (SoC,
NUS) (SoC, NUS)
CS3249
Beginning Qt
Beginning Qt
19
19
QWizard
CS3249 (SoC,
NUS) (SoC, NUS)
CS3249
Beginning Qt
Beginning Qt
20
20
Widget Styles
Beginning Qt
Beginning Qt
21
21
Plastique
Cleanlooks
GTK
Motif
CDE
Macintosh
Windows
Windows XP
Windows Vista
CS3249 (SoC,
NUS) (SoC, NUS)
CS3249
Beginning Qt
Beginning Qt
22
22
Plastique
Cleanlooks
GTK
Motif
CDE
Macintosh
Windows
Windows XP
Windows Vista
CS3249 (SoC,
NUS) (SoC, NUS)
CS3249
Beginning Qt
Beginning Qt
23
23
Radiance
X11
Windows
Windows 7
Macintosh
CS3249 (SoC, NUS)
CS3249 (SoC,
NUS) (SoC, NUS)
CS3249
Beginning Qt
Beginning Qt
24
24
Layout
Beginning Qt
Beginning Qt
25
25
QFormLayout
QVBoxLayout
QHBoxLayout
QGridLayout
CS3249 (SoC, NUS)
CS3249 (SoC,
NUS) (SoC, NUS)
CS3249
QStackedLayout
Beginning Qt
Beginning Qt
26
26
Summary
Beginning Qt
Beginning Qt
27
27
Further Reading
Beginning Qt
Beginning Qt
28
28
Reference
Beginning Qt
Beginning Qt
29
29