From 85cb98148670f0c74944cb79d093a4342966543f Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Wed, 14 Aug 2019 17:35:02 +0200 Subject: QmlDesigner: Fix potential crash It is not crashing with 5.12.3 and 5.13.0 Task-number: QDS-916 Change-Id: I87bd83b90b1eb74c7825564ea789def52eaa8df0 Reviewed-by: Thomas Hartmann --- .../qmldesigner/components/stateseditor/stateseditormodel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp index ae7400e382..cb4b7cfe0a 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp @@ -37,6 +37,8 @@ #include #include +#include + enum { debug = false }; @@ -181,10 +183,11 @@ void StatesEditorModel::renameState(int internalNodeId, const QString &newName) return; if (newName.isEmpty() ||! m_statesEditorView->validStateName(newName)) { - Core::AsynchronousMessageBox::warning(tr("Invalid state name"), + auto w = Core::AsynchronousMessageBox::warning(tr("Invalid state name"), newName.isEmpty() ? tr("The empty string as a name is reserved for the base state.") : tr("Name already used in another state")); + w->setAttribute(Qt::WA_ShowModal, false); reset(); } else { m_statesEditorView->renameState(internalNodeId, newName); -- cgit v1.2.3