diff options
| author | Axel Spoerl <axel.spoerl@qt.io> | 2025-12-11 12:22:49 +0100 |
|---|---|---|
| committer | Axel Spoerl <axel.spoerl@qt.io> | 2025-12-16 20:24:49 +0000 |
| commit | 39dc9b1d6634f6fbd6be3f80f423afee36e7f79a (patch) | |
| tree | c37c1ac61873701c9a918e55ef1e9823d9826929 /examples/qtestlib/tutorial5/tutorial5.pro | |
| parent | 04786ccc6706d8b22affe6140af343ac11c5a5e6 (diff) | |
Fix flakiness tst_QWidget::multipleToplevelFocusCheck()
The test function shows and activates a custom widget with a hidden
QLineEdit inside. It used QApplicationPrivate::setActiveWindow() to
force-set the active window. It then sent a mouse double click to the
custom window, which would subsequently show the line edit, set focus
on it and process events.
The use of QApplicationPrivate::setActiveWindow() and setting focus
to the line edit could cause a race codition, function call overrides
the line edit activation and its widget parent gets focus instead.
Remove calls to QApplicationPrivate::setActiveWindow().
Wait for the line edit to be focused, before returning from the
mouseDoubleClickEvent() override.
Unblacklist the test function.
As a drive-by: Remove unnecessary casts, optimize setting of
window titles and object names.
Fixes: QTBUG-64446
Fixes: QTBUG-84259
Pick-to: 6.11 6.10 6.8 6.5
Change-Id: I92953942db9c47ec08b7867928853753fd764798
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'examples/qtestlib/tutorial5/tutorial5.pro')
0 files changed, 0 insertions, 0 deletions
