View difference between Paste ID: cNEHW66p and RuygznwE
SHOW: | | - or go back to the newest paste.
1-
class What
1+
#ifndef DIALOG_H
2
#define DIALOG_H
3-
    int leftTime;
3+
4
#include <QDialog>
5
#include<QTimer>
6
7
8
class Round : public QDialog
9
{
10
    Q_OBJECT
11
    int leftTime,period;
12
    QTimer *mTimer;
13
14
public:
15
16
    Round()
17
    {
18
        leftTime = 3;
19
    period = 1;
20
        QTimer* mTimer = new QTimer();
21
        QObject::connect(mTimer, SIGNAL(timeout()), this, SLOT(Time()));
22
    }
23
24
    void showPics()
25
    {
26
27
       mTimer->start(1000);
28
    }
29
30
private slots:
31
32
    void Time()
33
    {
34
        if(leftTime > 0)
35-
         
35+
36
            leftTime--;
37
38
            if(leftTime == 0)
39
            {
40
41-
      
41+
42
43
44
        }
45
        else
46
        {
47
            mTimer->stop();
48-
        for(int i = 2; i <= numberPics; i++)
48+
49
50
            mTimer->start(period);
51
        }
52-
        mTimer->stop();
52+
53
54
    void changePic()
55-
};
55+
56
        /*for(int i = 2; i <= numberPics; i++)
57
        {
58
59
        }
60
        mTimer->stop();*/
61
62
    }
63
};
64
65
66
#endif // DIALOG_H