Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <QApplication>
- #include <QWidget>
- #include <QPushButton>
- #include <QLabel>
- #include <QTextStream>
- class App
- {
- int state = 0;
- public:
- App(int state) : state(state)
- {
- }
- void increment()
- {
- this->state++;
- }
- int getState()
- {
- return this->state;
- }
- };
- int main(int argc, char *argv[])
- {
- App appLogic(0);
- QApplication appPresentation(argc, argv);
- QWidget window;
- QPushButton *btn = new QPushButton("Increment", &window);
- btn->setGeometry(10, 10, 200, 50);
- QLabel *label = new QLabel(QString::number(appLogic.getState()), &window);
- label->setGeometry(10, 60, 100, 100);
- window.resize(640, 480);
- window.show();
- return appPresentation.exec();
- }
Advertisement
Add Comment
Please, Sign In to add comment