Results 1 to 5 of 5

Thread: QMessageBox.exec() does not block Producer-Consumer signal loop

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2012
    Posts
    17
    Qt products
    Qt4
    Platforms
    Windows

    Default QMessageBox.exec() does not block Producer-Consumer signal loop

    Hi!,
    I have a singlethreaded application which performs some longer task. The task is devided in to small portions and accomplished by Producer-Consumer, Qt::QueuedConnection, signal-slot loop. Everthing works well, gui is responsive.
    I have a 'Stop' button in the gui. In its 'onClick' event handler i am displaying a confirmation message with use of QMessageBox::exec() function.

    Unfortunately i am facing the following problem:
    When the confirmation message is displayed, sometimes the Producer-Consumer loop is blocked and sometimes it proceeds unaffected.
    I would like the modal confirmation box to block the execution of the Producer-Consumer loop.

    I have read that exec() runs its own event loop and this would explain why Producer-Consumer loop proceeds. However, i am confused with the fact that sometimes it is blocked. And still.. i would like to block this loop somehow.

    Any ideas?
    best regards.
    Last edited by airproject; 30th August 2012 at 11:48.

Similar Threads

  1. Any Qt code/example for producer consumer pattern?
    By Sheng in forum Qt Programming
    Replies: 1
    Last Post: 23rd February 2009, 21:11
  2. Replies: 16
    Last Post: 28th October 2008, 22:00
  3. Speed up Producer Consumer Threads
    By ^NyAw^ in forum Qt Programming
    Replies: 7
    Last Post: 29th February 2008, 18:38
  4. Producer Consumer...
    By Shuchi Agrawal in forum Newbie
    Replies: 1
    Last Post: 16th February 2007, 09:45
  5. Producer Consumer
    By ^NyAw^ in forum Qt Programming
    Replies: 16
    Last Post: 17th November 2006, 19:53

Tags for this Thread

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.