Using Qtimer instead of Sleep

Sample code to use Qtimer in Qt instead of Sleep if you want a stoppage in your code:
slideShowtimer = new QTimer(this);

        selectedPicture = 0;
        //QTimer::singleShot(5000, this, SLOT(slideShowHelper()));
        connect(slideShowtimer, SIGNAL(timeout()), this, SLOT(slideShowHelper()));
        slideShowtimer->start(1000);

Leave a Reply

Your email address will not be published. Required fields are marked *