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:
2026-07-13 10:19:30 +08:00
parent 21ae1125f5
commit b47887e127
+9 -3
View File
@@ -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);
} }
} }