Reinexen
26th December 2007, 01:57
Hi,
I'm having a problem with msleep function void QThread::msleep ( unsigned long msecs )
I dont really know how to use it.
I have a class "Labirynt" and a function in it: void Generate();
Something like this:
void Labirynt::Generate()
{
for(int i=10; i<100; i++)
{
//mathematical calculations (these are changing variables which are used in
// Labirynt::paintEvent [this is why i use update();])
QThread::msleep(20);
update();
}
}
My Error:
c:/Qt/4.3.3/include/QtCore/../../src/corelib/thread/qthread.h:108: error: `static void QThread::msleep(long unsigned int)' is protected
labirynt.cpp:67: error: within this context
What should i do to make it work?
When i use sleep from standard library program hangs up.
When i use my own sleep function program hangs up.
I'm having a problem with msleep function void QThread::msleep ( unsigned long msecs )
I dont really know how to use it.
I have a class "Labirynt" and a function in it: void Generate();
Something like this:
void Labirynt::Generate()
{
for(int i=10; i<100; i++)
{
//mathematical calculations (these are changing variables which are used in
// Labirynt::paintEvent [this is why i use update();])
QThread::msleep(20);
update();
}
}
My Error:
c:/Qt/4.3.3/include/QtCore/../../src/corelib/thread/qthread.h:108: error: `static void QThread::msleep(long unsigned int)' is protected
labirynt.cpp:67: error: within this context
What should i do to make it work?
When i use sleep from standard library program hangs up.
When i use my own sleep function program hangs up.