@@ -749,8 +749,14 @@ void ColorButton::showModal()
|
||||
setColor(currentColor);
|
||||
Q_EMIT changed();
|
||||
}
|
||||
setProperty("modal_dialog_active", false);
|
||||
});
|
||||
|
||||
/* A FocusOut event is sent when a native macOS color picker is opened, which
|
||||
* closes the editor and destroys this object. Set a property to ignore this event.
|
||||
*/
|
||||
setProperty("modal_dialog_active", true);
|
||||
|
||||
dlg->exec();
|
||||
}
|
||||
|
||||
|
||||
@@ -195,6 +195,12 @@ bool PropertyItemDelegate::eventFilter(QObject *o, QEvent *ev)
|
||||
}
|
||||
}
|
||||
else if (ev->type() == QEvent::FocusOut) {
|
||||
if (auto button = qobject_cast<Gui::ColorButton*>(o)) {
|
||||
// Ignore the event if the ColorButton's modal dialog is active.
|
||||
if (button->property("modal_dialog_active").toBool()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
auto parentEditor = qobject_cast<PropertyEditor*>(this->parent());
|
||||
if (auto* comboBox = qobject_cast<QComboBox*>(o)) {
|
||||
if (parentEditor && parentEditor->activeEditor == comboBox) {
|
||||
|
||||
Reference in New Issue
Block a user