]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // Copyright Vladimir Prus 2005. |
2 | // Distributed under the Boost Software License, Version 1.0. | |
1e59de90 TL |
3 | // (See accompanying file LICENSE.txt |
4 | // or copy at https://www.bfgroup.xyz/b2/LICENSE.txt) | |
7c673cae FG |
5 | |
6 | ||
7 | #include <qwidget.h> | |
8 | #include <qpushbutton.h> | |
9 | #include <qapplication.h> | |
10 | ||
11 | #include <iostream> | |
12 | ||
13 | class My_widget : public QWidget | |
14 | { | |
15 | Q_OBJECT | |
16 | public: | |
1e59de90 | 17 | My_widget() : QWidget() |
7c673cae FG |
18 | { |
19 | QPushButton* b = new QPushButton("Push me", this); | |
1e59de90 | 20 | |
7c673cae FG |
21 | connect(b, SIGNAL(clicked()), this, SLOT(theSlot())); |
22 | } | |
23 | ||
24 | private slots: | |
25 | void theSlot() | |
26 | { | |
27 | std::cout << "Clicked\n"; | |
1e59de90 TL |
28 | } |
29 | ||
7c673cae FG |
30 | }; |
31 | ||
32 | int main(int ac, char* av[]) | |
33 | { | |
34 | QApplication app(ac, av); | |
35 | My_widget mw; | |
36 | mw.show(); | |
37 | app.setMainWidget(&mw); | |
38 | app.exec(); | |
39 | } | |
40 | ||
41 | #include "main.moc" |