Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
5.0.2
-
None
-
Qt 5.0.2, Mac OS 10.8.4, MacBook Pro 15" retina mid-2013.
Behavior is experienced when running app from within Qt Creator 2.7.1, and when run from the Terminal (open activewindow.app), and when launched from Finder (double-click .app icon).
Description
A minimal example project demonstrating the bug is attached as a .zip file. Here is what it does:
1. main() creates an instance of MainWindow(), and calls show() and then setup() in it.
2. setup() creates a child widget of class QProgressDialog (on the stack), and simulates a two-second loading procedure, while the dialog goes from 0% to 100%. At the end of setup(), the dialog is automatically destroyed and hidden.
3. If you add code that waits one second (so the progress dialog is gone) and then uses qDebug() to dump the values of isActiveWindow() and ui->textEdit->hasFocus(), both report true. Furthermore, the cursor in the QTextEdit is blinking!
Bug: And yet, the user cannot type text in the QTextEdit; attempting to do so just produces the "bnng" error sound. Furthermore, the window indicates it doesn't really have focus, because the red "close" button is not lit, as in the second attachment. One must click the window (or Cmd-Tab away and back) to get it to really have focus, and light up the red "close" button, as in the third attachment.
Expected behavior: When the progress dialog goes away, and the cursor starts blinking, that should indicate that the main window really has focus, especially since various Qt functions say it does, and the window is active. The user should be able to type in the widget.