diff options
author | Tim Jenssen <tim.jenssen@qt.io> | 2019-08-14 17:35:02 +0200 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2019-08-14 15:37:54 +0000 |
commit | 85cb98148670f0c74944cb79d093a4342966543f (patch) | |
tree | 6f2f72aa2c698d6a46af55c21ea3b5188e918c99 /src | |
parent | ab9aae4856872978f7a492f1991077ab87e9b7bd (diff) |
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 <thomas.hartmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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 <coreplugin/icore.h> #include <coreplugin/messagebox.h> +#include <QWidget> + 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); |