diff --git a/src/Gui/propertyeditor/PropertyItemDelegate.cpp b/src/Gui/propertyeditor/PropertyItemDelegate.cpp index 73abaf8464..42ee976a89 100644 --- a/src/Gui/propertyeditor/PropertyItemDelegate.cpp +++ b/src/Gui/propertyeditor/PropertyItemDelegate.cpp @@ -25,6 +25,7 @@ #ifndef _PreComp_ # include +# include # include # include #endif @@ -127,7 +128,16 @@ bool PropertyItemDelegate::editorEvent (QEvent * event, QAbstractItemModel* mode bool PropertyItemDelegate::eventFilter(QObject *o, QEvent *ev) { - if (ev->type() == QEvent::FocusOut) { + if (ev->type() == QEvent::FocusIn) { + auto *comboBox = qobject_cast(o); + if (comboBox) { + auto parentEditor = qobject_cast(this->parent()); + if (parentEditor && parentEditor->activeEditor == comboBox) { + comboBox->showPopup(); + } + } + } + else if (ev->type() == QEvent::FocusOut) { auto parentEditor = qobject_cast(this->parent()); auto widget = qobject_cast(o); if (widget && parentEditor && parentEditor->activeEditor @@ -218,6 +228,10 @@ void PropertyItemDelegate::valueChanged() if (propertyEditor) { Base::FlagToggler<> flag(changed); Q_EMIT commitData(propertyEditor); + auto *comboBox = qobject_cast(propertyEditor); + if (comboBox) { + Q_EMIT closeEditor(propertyEditor); + } } }