Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //main.cpp
  2. #include <QApplication>
  3. #include <QWidget>
  4. #include <QPushButton>
  5. #include <QLayout>
  6. #include <QDebug>
  7.  
  8. int main(int argc, char *argv[])
  9. {
  10.     QApplication app(argc, argv);
  11.     QWidget win;
  12.     win.resize(300, 200);
  13.     win.setWindowTitle("Хелло, Deema");
  14.  
  15.     QPushButton button("Hello perdoliques");
  16.     QObject::connect(&button, &QPushButton::clicked, &app, &QCoreApplication::quit);
  17.     QObject::connect(&button, &QPushButton::clicked, [](){
  18.         qDebug() << "Вечер в хату";
  19.     });
  20.  
  21.     QVBoxLayout lay;
  22.     lay.setAlignment(Qt::AlignHCenter);
  23.     lay.addWidget(&button);
  24.  
  25.     win.setLayout(&lay);
  26.     win.show();
  27.  
  28.     return app.exec();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement