Results 1 to 2 of 2

Thread: Problem with modal QProgressDialog

  1. #1
    Join Date
    Jan 2009
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Exclamation Problem with modal QProgressDialog

    I have a problem with a modal QProgressDialog.

    In my application I need a QProgessDialog, but this dialog is activated by a context menu.

    When I click in the context menu, then appears the de modal dialog. I recive the QEvent::MouseButtonPress when I click in the context menu, but I don't recive the QEvent::MouseButtonRelease. I think that the modal dialog block the QEvent::MouseButtonRelease.

    I need to recive the QEvent::MouseButtonRelease. Is it possible?

    Thanks, and sorry for my English

  2. #2
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem with modal QProgressDialog

    if it's QProgressDialog receiving that event (and stopping it), you can subclass QProgressDialog and override event(QEvent *event) method like this:
    Qt Code:
    1. bool MyProgressDialog::event(QEvent *e)
    2. {
    3. if (e->type() == QEvent::MouseButtonRelease)
    4. {
    5. QApplication::sendEvent(parent, e);
    6. return true;
    7. }
    8. return QProgressDialog::event(e);
    9. }
    To copy to clipboard, switch view to plain text mode 
    where parent of your dialog is the object where you want that event to receive. If not, you can pass a pointer to object via constructor.

Similar Threads

  1. Problem QWizardPage not modal
    By Rooster1 in forum Qt Programming
    Replies: 4
    Last Post: 30th December 2008, 09:04
  2. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  3. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  4. modal dialog blocking problem...
    By photonmaster in forum Qt Programming
    Replies: 3
    Last Post: 4th June 2008, 09:49
  5. Bug with modal windows on Mac? [Qt 3.3]
    By kalos80 in forum Qt Programming
    Replies: 0
    Last Post: 15th February 2008, 16:52

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.