|
|
- #include "menudialog.h"
- #include "ui_menudialog.h"
-
- MenuDialog::MenuDialog(QWidget *parent) :
- QDialog(parent),
- ui(new Ui::MenuDialog)
- {
- ui->setupUi(this);
-
- initUI();
-
- }
-
- MenuDialog::~MenuDialog()
- {
- delete ui;
- }
-
- void MenuDialog::initUI()
- {
- uodateNumbers();
- updateImage();
- }
-
-
-
- void MenuDialog::uodateNumbers()
- {
- QString randomString = getRandomString(40);
- ui->label_number1->setText(randomString.mid(0,8));
- ui->label_number2->setText(randomString.mid(8,8));
- ui->label_number3->setText(randomString.mid(16,8));
- ui->label_number4->setText(randomString.mid(24,8));
- ui->label_number5->setText(randomString.mid(32,8));
- }
-
- void MenuDialog::updateImage()
- {
- QImage image(":/resources/gilr.jpg");
- image = image.scaled(200, 200);
- ui->label_Image->setPixmap(QPixmap::fromImage(image));
- }
-
-
- void MenuDialog::on_pushButton_exit_clicked()
- {
- QCoreApplication *app = (static_cast<QApplication *>(QCoreApplication::instance()));
- app->exit(0);
- }
-
-
|