forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Thomas Hartmann
parent
ab9aae4856
commit
85cb981486
@@ -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);
|
||||
|
Reference in New Issue
Block a user