From cd6ecebad770932034b4b5efa8e288acc1c92c9e Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Fri, 24 May 2013 20:25:40 +0200 Subject: 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 Reviewed-by: Shawn Rutledge --- src/shared/qtpropertybrowser/qtpropertybrowser.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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, -- cgit v1.2.1