diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2013-05-24 20:25:40 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-28 09:47:33 +0200 |
commit | cd6ecebad770932034b4b5efa8e288acc1c92c9e (patch) | |
tree | e477cd77be65ba3b33b78e2698c29dd528b5bdb0 | |
parent | 31fd7854c2fcdde903c00203d69aeb3f6259dd9d (diff) |
Fix combobox not opening in treeview item delegate editor
This is the same fix as for QTBUG-30715, which leads me to think that
we should spend some more time and re-think how QComboBox gets focus.
See also qtbase 3b992f831.
Task-number: QTBUG-31298
Change-Id: I4393af00c8896051e9ed8b5d8af510633106913c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
-rw-r--r-- | src/shared/qtpropertybrowser/qtpropertybrowser.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/shared/qtpropertybrowser/qtpropertybrowser.cpp b/src/shared/qtpropertybrowser/qtpropertybrowser.cpp index 495c71c82..bd1305f19 100644 --- a/src/shared/qtpropertybrowser/qtpropertybrowser.cpp +++ b/src/shared/qtpropertybrowser/qtpropertybrowser.cpp @@ -1867,7 +1867,14 @@ QWidget *QtAbstractPropertyBrowser::createEditor(QtProperty *property, if (!factory) return 0; - return factory->createEditor(property, parent); + QWidget *w = factory->createEditor(property, parent); + // Since some editors can be QComboBoxes, and we changed their focus policy in Qt 5 + // to make them feel more native on Mac, we need to relax the focus policy to something + // more permissive to keep the combo box from losing focus, allowing it to stay alive, + // when the user clicks on it to show the popup. + if (w) + w->setFocusPolicy(Qt::WheelFocus); + return w; } bool QtAbstractPropertyBrowser::addFactory(QtAbstractPropertyManager *abstractManager, |