Advertisement
Guest User

byme

a guest
Sep 7th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef DIALOG_H
  2. #define DIALOG_H
  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.         {
  36.             leftTime--;
  37.  
  38.             if(leftTime == 0)
  39.             {
  40.  
  41.             }
  42.  
  43.  
  44.         }
  45.         else
  46.         {
  47.             mTimer->stop();
  48.             QObject::connect(mTimer, SIGNAL(timeout()), this, SLOT(changePic()));
  49.  
  50.             mTimer->start(period);
  51.         }
  52.     }
  53.  
  54.     void changePic()
  55.     {
  56.         /*for(int i = 2; i <= numberPics; i++)
  57.         {
  58.  
  59.         }
  60.         mTimer->stop();*/
  61.  
  62.     }
  63. };
  64.  
  65.  
  66. #endif // DIALOG_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement