Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "AppSedy.h"
- #include <QtWidgets/QApplication>
- #include <qlabel.h>
- #include <qpushbutton.h>
- #include <qboxlayout.h>
- #include <qlistwidget.h>
- #include <qmessagebox.h>
- int main(int argc, char *argv[])
- {
- QApplication a(argc, argv);
- QWidget* app = new QWidget;
- QVBoxLayout* lay = new QVBoxLayout;
- QListWidget* list = new QListWidget;
- app->setLayout(lay);
- QLabel* lbl = new QLabel(" Seby sta in gara bacu asta?");
- QFont font = lbl->font();
- font.setPointSize(42);
- font.setBold(true);
- lbl->setFont(font);
- lay->addWidget(lbl);
- lay->addSpacing(70);
- //lay->addWidget(list);
- QHBoxLayout* layH = new QHBoxLayout;
- QPushButton* butonNu = new QPushButton("Nu");
- QPushButton* butonDa = new QPushButton("Da");
- QPushButton* butonNup = new QPushButton("Butonul asta nu merge");
- QHBoxLayout* lay2 = new QHBoxLayout;
- QPushButton* butonIepures = new QPushButton("Nici asta");
- lay2->addWidget(butonNup);
- layH->addWidget(butonNu);
- //layH->addStretch();
- layH->addWidget(butonDa);
- lay->addLayout(layH);
- lay->addStretch();
- lay->addLayout(lay2);
- lay->addStretch();
- lay->addWidget(butonIepures);
- QObject::connect(butonNu, &QPushButton::clicked, [&]() {
- QMessageBox::warning(nullptr, "Warning", "Boamba zice altceva");
- });
- QObject::connect(butonDa, &QPushButton::clicked, [&]() {
- QMessageBox::warning(nullptr, "Warning", "Felicitari! Ai castigat o pula de negru!");
- });
- QObject::connect(butonIepures, &QPushButton::clicked, [&]() {
- QMessageBox::warning(nullptr, "Warning", "Teapa pulane!");
- });
- app->show();
- return a.exec();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement