waf/demos/qt5/foo.cpp

39 lines
687 B
C++
Raw Normal View History

2016-05-01 13:21:06 +02:00
// Thomas Nagy, 2011-2016
2011-09-10 11:13:51 +02:00
#include "foo.h"
Foo::Foo() : QWidget(NULL) {
m_button = new QPushButton("Foo Button", this);
m_button->setGeometry(QRect(QPoint(50, 60),
QSize(120, 50)));
connect(m_button, SIGNAL (released()), this, SLOT (handleButton()));
myToggle = true;
}
void Foo::handleButton() {
if (myToggle) {
m_button->setText("Button Foo");
} else {
m_button->setText("Foo Button");
}
myToggle = !myToggle;
}
2011-09-10 11:13:51 +02:00
int Foo::FortyTwo() {
return 42;
2011-09-10 11:13:51 +02:00
}
2011-12-31 14:32:38 +01:00
class Bar_private : public QWidget {
Q_OBJECT
signals:
void test();
public:
Bar_private();
};
Bar_private::Bar_private() : QWidget(NULL) {
}
2011-09-10 11:13:51 +02:00
#include "foo.moc"