]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/example/qt/qt3/moccable-cpp/main.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / tools / build / example / qt / qt3 / moccable-cpp / main.cpp
CommitLineData
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
13class My_widget : public QWidget
14{
15 Q_OBJECT
16public:
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
24private slots:
25 void theSlot()
26 {
27 std::cout << "Clicked\n";
1e59de90
TL
28 }
29
7c673cae
FG
30};
31
32int 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"