Je voudrais éclater cette classe en un .h et un .cpp mais j'y arrive pas.
Là elle est dans un .h.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
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()
{
  timer.start();
  return QDialog::exec();
}
 
private:
  QTimer timer;
};