Results 1 to 7 of 7

Thread: Application Lockup poping up dialog

  1. #1
    Join Date
    Jan 2006
    Location
    Bend, Oregon
    Posts
    27
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Unhappy Application Lockup while popping up dialog

    I ran into a problem with poping up a dialog window (a simple message box will do) while the application is moved (by the user using the mouse and dragging the application).
    I narrowed it down to a few lines of code (attached, I'm using PyQt but I'm sure this will be the same for the C++ interface).

    Basically I pop up a simple dialog in a timer event. If the application is just sitting there everything is fine and the dialog pops up and the user can acknowledge it just fine. However, if the user holds down the mouse button on the application caption (starting of a drag operation) while the timer expires and the dialog pops up the entire application is frozen. Not only the application but all applications on the desktop are frozen. It seems like the mouse is captured and not released properly. I can close the dialog by pushing the ESC button. This will also allow to interact with all other applications.

    I'm using Windows XP, Qt 3.3.1. I tested with Qt 2.3.0 and this does not occur, mostly due to the fact that the timer stops while dragging the window and therefore the dialog never pops up while the mouse is held down on the application.

    Any solutions would be highly appreciated.

    Thanks,
    Tommy




    Qt Code:
    1. import sys
    2. import qt
    3.  
    4. class TMainWindow(qt.QMainWindow):
    5. def __init__(self, *args):
    6. qt.QMainWindow.__init__(self, *args)
    7.  
    8. self.label = qt.QLabel(self)
    9. self.c=0
    10.  
    11. self.oTimer = qt.QTimer(self)
    12. self.connect(self.oTimer, qt.SIGNAL('timeout()'), self.fOnTimer)
    13. self.oTimer.start(100)
    14.  
    15. def closeEvent(self, e):
    16. oApp.quit()
    17.  
    18. def fOnTimer(self):
    19. self.c +=1
    20. self.label.setText('%d' % self.c)
    21.  
    22. if self.c == 50:
    23. qt.QMessageBox.critical(self, 'caption', 'lockup...')
    24.  
    25. oApp = qt.QApplication(sys.argv)
    26. oMainWindow = TMainWindow(None, 'Main Window')
    27. oMainWindow.show()
    28. oApp.exec_loop()
    To copy to clipboard, switch view to plain text mode 
    Last edited by Tommytrojan; 28th April 2006 at 19:11. Reason: Typos

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Application Lockup poping up dialog

    I have Qt 3.3.6 and PyQt 3.15.1 and everything is fine.

  3. #3
    Join Date
    Jan 2006
    Location
    Bend, Oregon
    Posts
    27
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Application Lockup poping up dialog

    Are you holding down the mouse on the title bar of the app while the dialog is popping up?

    Thomas

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Application Lockup poping up dialog

    Quote Originally Posted by Tommytrojan
    Are you holding down the mouse on the title bar of the app while the dialog is popping up?
    Yes and everything is fine --- message box pops up, counter still counts and I can move both windows.

  5. #5
    Join Date
    Jan 2006
    Location
    Bend, Oregon
    Posts
    27
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Application Lockup poping up dialog

    Thanks. I will upgrade to the version you said you are running.

    Tommy

  6. #6
    Join Date
    May 2007
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Application Lockup poping up dialog

    I am getting error in 2nd line

    import qt

    Getting error like below:
    unresolved symbol qt

    What could be the problem?

    Error Description is:

    Traceback (most recent call last):
    File "D:\users\PyQtWorkspace\test\src\testpkg\TestQt.py ", line 2, in <module>
    import qt
    ImportError: No module named qt
    Last edited by jacek; 30th July 2007 at 21:44. Reason: merged two posts

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Application Lockup poping up dialog

    Quote Originally Posted by kishor_ys View Post
    What could be the problem?
    Do you have PyQt installed?

Similar Threads

  1. Issue with Modelless dialog on Mac
    By Satyanarayana Chebrolu in forum Qt Programming
    Replies: 0
    Last Post: 24th February 2009, 11:10
  2. Show dialog application lunched as a process.
    By mourad in forum Qt Programming
    Replies: 0
    Last Post: 13th October 2008, 14:27
  3. Showing a dialog at application startup
    By PaladinOfKaos in forum Qt Programming
    Replies: 3
    Last Post: 1st April 2008, 21:05
  4. Replies: 3
    Last Post: 31st March 2006, 19:38
  5. Replies: 1
    Last Post: 15th February 2006, 23:17

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
  •  
Qt is a trademark of The Qt Company.