Defer parameter editor panel raise/focus to queued invocation
KDDockWidgets may need an event-loop iteration to finish opening or tabifying a dock widget before raise() can switch to it. Defer raise(), activateWindow(), and setFocus() via QMetaObject::invokeMethod with Qt::QueuedConnection after show().
This commit is contained in:
@@ -1686,9 +1686,15 @@ void NodeView::ShowSelectedNodeInParamEditor()
|
|||||||
if (PanelWidget *panel = PanelManager::instance()->GetPanelWithName(
|
if (PanelWidget *panel = PanelManager::instance()->GetPanelWithName(
|
||||||
QStringLiteral("ParamPanel"))) {
|
QStringLiteral("ParamPanel"))) {
|
||||||
panel->show();
|
panel->show();
|
||||||
panel->setAsCurrentTab();
|
QMetaObject::invokeMethod(panel, &PanelWidget::raise,
|
||||||
panel->activateWindow();
|
Qt::QueuedConnection);
|
||||||
panel->setFocus(Qt::OtherFocusReason);
|
QMetaObject::invokeMethod(
|
||||||
|
panel,
|
||||||
|
[panel]() {
|
||||||
|
panel->activateWindow();
|
||||||
|
panel->setFocus(Qt::OtherFocusReason);
|
||||||
|
},
|
||||||
|
Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user