Results 1 to 3 of 3

Thread: QWaitCondition function wait() error

  1. #1
    Join Date
    May 2009
    Posts
    55
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default QWaitCondition function wait() error

    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()'.

    Qt Code:
    1. /window.h
    2. Private:
    3. QWaitCondition waitCondtion;
    4. QWaitCondition* pWaitCondition;
    5. ComputeThread* computeThread;
    6.  
    7. //window.cpp
    8. Window::Window()
    9. {
    10. pWaitCondition = waitCondition;
    11. computeThread = new ComputeThread(pWaitCondition);
    12. }
    13.  
    14. //computethread.h
    15. Private:
    16. QWaitCondition* newImage;
    17.  
    18. //computethread.cpp
    19. ComputeThread::ComputeThread(QWaitCondition* wc)
    20. {
    21. newImage = wc;
    22. }
    23.  
    24. void ComputeThread::run()
    25. {
    26. newImage->wait(); //error goes here
    To copy to clipboard, switch view to plain text mode 

    what could be wrong? TIA.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QWaitCondition function wait() error

    QWaitCondition::wait() requires exactly one parameter, the mutex it works on.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2009
    Posts
    55
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QWaitCondition function wait() error

    I see. It was changed at Qt4. I was looking at Qt3 QWaitCondition. Thanks.

Similar Threads

  1. ODBC function sequence error
    By joseph in forum Qt Programming
    Replies: 9
    Last Post: 7th November 2014, 12:32
  2. Replies: 0
    Last Post: 4th November 2009, 10:21
  3. Wait for a function to finish
    By fitzy in forum General Programming
    Replies: 3
    Last Post: 26th October 2009, 18:20
  4. no matching function error
    By arpspatel in forum Qt Programming
    Replies: 4
    Last Post: 16th October 2009, 15:47
  5. QWaitCondition
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 24th October 2007, 16:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.