Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
4.7.0
-
None
-
Windows XP, Visual Studio 2008, Qt Integration
Description
I intended to get the main window of the application and set the keyboard focus on it.
After heaving read the API documentation I recognize that this command does not do what I've intended.
I understand that this is nonsense, as activeWindow() has already the keyboard focus.
Nevertheless this should not cause a program to abbort.
Call Stack:
> QtGuid4.dll!QWidget::testAttribute(Qt::WidgetAttribute attribute=WA_Disabled) Line 1025 + 0x3 bytes C++
QtGuid4.dll!QWidget::isEnabled() Line 930 + 0x11 bytes C++
QtGuid4.dll!QWidget::setFocus(Qt::FocusReason reason=OtherFocusReason) Line 6109 + 0x8 bytes C++
QtGuid4.dll!QWidget::setFocus() Line 420 + 0x11 bytes C++
The documentation says:
Warning: If you call setFocus() in a function which may itself be called from focusOutEvent() or focusInEvent(), you may get an infinite recursion.
Please extend the documentation.
Warning: activeWindow()->setFocus() might result in an unhandled exception
or fix the program abbort.