Namespaces
Variants
Actions

Introducing Delay In Qt Application

Jump to: navigation, search

This code snippet shows how to introduce delay in our application using QThread::msleep().

Article Metadata

Tested with
Devices(s): Emulator / desktop / device

Compatibility
Platform(s): All Qt Supported

Article
Keywords: QThread
Created: skumar_rao (29 Nov 2010)
Last edited: hamishwillee (11 Oct 2012)

First create a sleeper thread:

class SleeperThread : public QThread
{
public:
static void msleep(unsigned long msecs)
{
QThread::msleep(msecs);
}
};

You can then use this as shown below:

SleeperThread::msleep(10*1000);
This page was last modified on 11 October 2012, at 04:17.
158 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved