Last change
on this file since 244 was 2, checked in by Dmitry A. Kuminov, 16 years ago |
Initially imported qt-all-opensource-src-4.5.1 from Trolltech.
|
File size:
1.2 KB
|
Line | |
---|
1 | //! [0]
|
---|
2 | QT -= gui
|
---|
3 | //! [0]
|
---|
4 |
|
---|
5 |
|
---|
6 | //! [1]
|
---|
7 | QT += network opengl sql qt3support
|
---|
8 | //! [1]
|
---|
9 |
|
---|
10 |
|
---|
11 | //! [2]
|
---|
12 | CONFIG += uic3
|
---|
13 | //! [2]
|
---|
14 |
|
---|
15 |
|
---|
16 | //! [3]
|
---|
17 | #include <QClassName>
|
---|
18 | //! [3]
|
---|
19 |
|
---|
20 |
|
---|
21 | //! [4]
|
---|
22 | #include <QString>
|
---|
23 | #include <QApplication>
|
---|
24 | #include <QSqlTableModel>
|
---|
25 | //! [4]
|
---|
26 |
|
---|
27 |
|
---|
28 | //! [5]
|
---|
29 | #include <qclassname.h>
|
---|
30 | //! [5]
|
---|
31 |
|
---|
32 |
|
---|
33 | //! [6]
|
---|
34 | #include <QtCore>
|
---|
35 | //! [6]
|
---|
36 |
|
---|
37 |
|
---|
38 | //! [7]
|
---|
39 | using namespace Qt;
|
---|
40 | //! [7]
|
---|
41 |
|
---|
42 |
|
---|
43 | //! [8]
|
---|
44 | QLabel *label1 = new QLabel("Hello", this);
|
---|
45 | QLabel *label2 = new QLabel(this, "Hello");
|
---|
46 | //! [8]
|
---|
47 |
|
---|
48 |
|
---|
49 | //! [9]
|
---|
50 | MyWidget::MyWidget(QWidget *parent, const char *name)
|
---|
51 | : QWidget(parent, name)
|
---|
52 | {
|
---|
53 | ...
|
---|
54 | }
|
---|
55 | //! [9]
|
---|
56 |
|
---|
57 |
|
---|
58 | //! [10]
|
---|
59 | // DEPRECATED
|
---|
60 | if (obj->inherits("QPushButton")) {
|
---|
61 | QPushButton *pushButton = (QPushButton *)obj;
|
---|
62 | ...
|
---|
63 | }
|
---|
64 | //! [10]
|
---|
65 |
|
---|
66 |
|
---|
67 | //! [11]
|
---|
68 | QPushButton *pushButton = qobject_cast<QPushButton *>(obj);
|
---|
69 | if (pushButton) {
|
---|
70 | ...
|
---|
71 | }
|
---|
72 | //! [11]
|
---|
73 |
|
---|
74 |
|
---|
75 | //! [12]
|
---|
76 | QLabel *label = new QLabel;
|
---|
77 | QPointer<QLabel> safeLabel = label;
|
---|
78 | safeLabel->setText("Hello world!");
|
---|
79 | delete label;
|
---|
80 | // safeLabel is now 0, whereas label is a dangling pointer
|
---|
81 | //! [12]
|
---|
82 |
|
---|
83 |
|
---|
84 | //! [13]
|
---|
85 | QT += qt3support
|
---|
86 | //! [13]
|
---|
87 |
|
---|
88 |
|
---|
89 | //! [14]
|
---|
90 | DEFINES += QT3_SUPPORT
|
---|
91 | //! [14]
|
---|
92 |
|
---|
93 |
|
---|
94 | //! [15]
|
---|
95 | DEFINES += QT3_SUPPORT_WARNINGS
|
---|
96 | //! [15]
|
---|
97 |
|
---|
98 |
|
---|
99 | //! [16]
|
---|
100 | DEFINES += QT3_SUPPORT
|
---|
101 | //! [16]
|
---|
Note:
See
TracBrowser
for help on using the repository browser.