PDA

View Full Version : QWaitCondition function wait() error



freekill
8th January 2010, 01:14
I settled for QWaitCondition with the idea of having my image buffer alert sleeping threads via waitCondition.wakeAll() and have the run() functions of the rendering and computing threads sleep when done with its current processing via waitCondition.wait(). I kept pointers to the waitCondition to allow the various threads access to it. However, I'm having this compile-time error in my computing thread: no matching function for call to 'QWaitCondition::wait()'.



/window.h
Private:
QWaitCondition waitCondtion;
QWaitCondition* pWaitCondition;
ComputeThread* computeThread;

//window.cpp
Window::Window()
{
pWaitCondition = waitCondition;
computeThread = new ComputeThread(pWaitCondition);
}

//computethread.h
Private:
QWaitCondition* newImage;

//computethread.cpp
ComputeThread::ComputeThread(QWaitCondition* wc)
{
newImage = wc;
}

void ComputeThread::run()
{
newImage->wait(); //error goes here


what could be wrong? TIA.

wysota
8th January 2010, 19:41
QWaitCondition::wait() requires exactly one parameter, the mutex it works on.

freekill
10th January 2010, 01:54
I see. It was changed at Qt4. I was looking at Qt3 QWaitCondition (http://doc.trolltech.com/3.3/qwaitcondition.html). Thanks.