#include "waitdialog.h" #include "ui_waitdialog.h" #include #include WaitDialog::WaitDialog(QWidget *parent) : QDialog(parent), ui(new Ui::WaitDialog) { ui->setupUi(this); _timer = new QTimer(); connect(_timer, &QTimer::timeout, this, &WaitDialog::timeout); _timer->start(250); setText(); } /*************************************************************************************************/ WaitDialog::~WaitDialog() { delete ui; delete _timer; } /*************************************************************************************************/ void WaitDialog::timeout() { setText(); } /*************************************************************************************************/ void WaitDialog::setText() { QString str = "Please wait"; for(auto i = 0; i < _state; i++) str += "."; _state++; if(_state > 3) _state = 0; ui->l_text->setText(str); }