QmlDesigner: Open dialog asynchronous

Change-Id: I4229ebb813d09680e6838f90469e7bb95b919f56
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2019-08-19 11:36:27 +02:00
parent c51da3805d
commit 8b2ac90bb3

View File

@@ -183,11 +183,12 @@ void StatesEditorModel::renameState(int internalNodeId, const QString &newName)
return; return;
if (newName.isEmpty() ||! m_statesEditorView->validStateName(newName)) { if (newName.isEmpty() ||! m_statesEditorView->validStateName(newName)) {
QTimer::singleShot(0, [newName]{
auto w = Core::AsynchronousMessageBox::warning(tr("Invalid state name"), auto w = Core::AsynchronousMessageBox::warning(tr("Invalid state name"),
newName.isEmpty() ? newName.isEmpty() ?
tr("The empty string as a name is reserved for the base state.") : tr("The empty string as a name is reserved for the base state.") :
tr("Name already used in another state")); tr("Name already used in another state"));
w->setAttribute(Qt::WA_ShowModal, false); });
reset(); reset();
} else { } else {
m_statesEditorView->renameState(internalNodeId, newName); m_statesEditorView->renameState(internalNodeId, newName);