Results 1 to 2 of 2

Thread: QProgressDialogButton is not responding

  1. #1
    Join Date
    Nov 2010
    Posts
    7
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QProgressDialogButton is not responding

    Hello

    I am having a problem using QProgressDialog.

    The problem I am having is that when I try to get QProgressDialog to run with a cancel option, I cannot click the button and therefore it will not exit the calculation operation.

    I have done some digging around and I have seen that if a complex calculation is going on, then this could be the reason. However, this calculation is running in its own seperate thread and I would have thought would have therefore been 'de-coupled' from the main GUI.

    At the moment QProgressDialog is being called from the thread doing the calculation and in an effort to try and de-couple it further, I have made a custom QProgressDialog class which is its own seperate thread. Although this still doesnt seem to work.

    Would I need to make the QProgressDialog a child of the main GUI and keep the calculations processing in its own thread?

    I am at a bit of a loss at what to really do....

    Many Thanks
    Geoff

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QProgressDialogButton is not responding

    At the moment QProgressDialog is being called from the thread doing the calculation
    You cannot use QtGui components (like widgets) in thread other than main GUI thread. Implement communication with the worker thread using signals and slots - create a subclass of QObject to perform calculations and give it "void progress(int)" signal to indicate progress of calculation. Next, connect this signal to setValue(int) slot in QProgressDialog with Qt::QueuedConnection. In order to pause calculations, create a "void pause()" slot in this worker class and connect void QProgressDialog::canceled () to it. Then create QThread object, start it and moveToThread() your object which performs calculations.

Similar Threads

  1. USB Keyboard is not responding in qt-embedded-4.4.3
    By grsandeep85 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 7th April 2011, 03:13
  2. Slider not responding to Signal
    By eLancaster in forum Newbie
    Replies: 3
    Last Post: 26th December 2010, 09:51
  3. Designer not responding to mouse
    By brtip in forum Newbie
    Replies: 0
    Last Post: 28th July 2010, 05:09
  4. QGraphicsTextItem Linkactivated not responding
    By Pancho in forum Qt Programming
    Replies: 1
    Last Post: 2nd December 2009, 22:39
  5. Window not responding
    By markcole in forum Qt Programming
    Replies: 10
    Last Post: 18th April 2007, 21:53

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.