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(
|
||||
QStringLiteral("ParamPanel"))) {
|
||||
panel->show();
|
||||
panel->setAsCurrentTab();
|
||||
panel->activateWindow();
|
||||
panel->setFocus(Qt::OtherFocusReason);
|
||||
QMetaObject::invokeMethod(panel, &PanelWidget::raise,
|
||||
Qt::QueuedConnection);
|
||||
QMetaObject::invokeMethod(
|
||||
panel,
|
||||
[panel]() {
|
||||
panel->activateWindow();
|
||||
panel->setFocus(Qt::OtherFocusReason);
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user