wysota: It is true that I have to learn, and I thank you for your attitude.
For info, your class had a bug, the correct code is :
class WaitDialog
: public QDialog {public:
{
l->addWidget(lab);
setLayout(l);
timer.setSingleShot(true);
timer.setInterval(interval);
connect(&timer, SIGNAL(timeout()), this, SLOT(accept()));
}
int exec() // rather than void
{
timer.start();
return QDialog::exec();
// needed return }
private:
};
class WaitDialog : public QDialog {
public:
WaitDialog(uint interval, QWidget *p=0) : QDialog(p)
{
QVBoxLayout *l = new QVBoxLayout(this);
QLabel *lab = new QLabel("Please wait");
l->addWidget(lab);
setLayout(l);
timer.setSingleShot(true);
timer.setInterval(interval);
connect(&timer, SIGNAL(timeout()), this, SLOT(accept()));
}
int exec() // rather than void
{
timer.start();
return QDialog::exec(); // needed return
}
private:
QTimer timer;
};
To copy to clipboard, switch view to plain text mode
Then to call it :
WaitDialog waitDialog_dlg( 2000, this );
if ( waitDialog_dlg.exec() )
{
}
WaitDialog waitDialog_dlg( 2000, this );
if ( waitDialog_dlg.exec() )
{
}
To copy to clipboard, switch view to plain text mode
I learn slowly, but I am stubborn and I will get there.
Bookmarks