aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMahmoud Badri <mahmoud.badri@qt.io>2021-09-15 12:28:48 +0300
committerMahmoud Badri <mahmoud.badri@qt.io>2021-09-16 13:22:46 +0000
commiteb870fb5c4f92e0299a8eb5a80e044de7e2aa657 (patch)
tree03e976d15ca808c64a3802ef429c9909865420f8 /src
parent7c5a830111c793aa51b991e8eabdaf0e2abdd1f0 (diff)
QmlDesigner: Include the ID in the invalid ID message
Change-Id: Ieacf36991cbe5e5f96cdc8dc26413cbbaec25608 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp2
-rw-r--r--src/plugins/qmldesigner/designercore/model/modelnode.cpp12
2 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp
index a603070172..a647b65358 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp
@@ -165,7 +165,7 @@ void PropertyEditorView::changeValue(const QString &name)
m_locked = false;
QString errMsg = QmlDesigner::ModelNode::getIdValidityErrorMessage(newId);
if (!errMsg.isEmpty())
- Core::AsynchronousMessageBox::warning(tr("Invalid ID"), errMsg.arg(newId));
+ Core::AsynchronousMessageBox::warning(tr("Invalid ID"), errMsg);
else
Core::AsynchronousMessageBox::warning(tr("Invalid ID"), tr("%1 already exists.").arg(newId));
}
diff --git a/src/plugins/qmldesigner/designercore/model/modelnode.cpp b/src/plugins/qmldesigner/designercore/model/modelnode.cpp
index 9e1e260bb0..924172b5b1 100644
--- a/src/plugins/qmldesigner/designercore/model/modelnode.cpp
+++ b/src/plugins/qmldesigner/designercore/model/modelnode.cpp
@@ -218,21 +218,21 @@ QString ModelNode::getIdValidityErrorMessage(const QString &id)
return {}; // valid
if (id.at(0).isUpper())
- return QObject::tr("ID cannot start with an uppercase character.");
+ return QObject::tr("ID cannot start with an uppercase character (%1).").arg(id);
if (id.at(0).isDigit())
- return QObject::tr("ID cannot start with a number.");
+ return QObject::tr("ID cannot start with a number (%1).").arg(id);
if (id.contains(' '))
- return QObject::tr("ID cannot include whitespace.");
+ return QObject::tr("ID cannot include whitespace (%1).").arg(id);
if (idIsQmlKeyWord(id))
- return QObject::tr("%1 is a reserved QML keyword.");
+ return QObject::tr("%1 is a reserved QML keyword.").arg(id);
if (isIdToAvoid(id))
- return QObject::tr("%1 is a reserved property keyword.");
+ return QObject::tr("%1 is a reserved property keyword.").arg(id);
- return QObject::tr("ID includes invalid characters.");
+ return QObject::tr("ID includes invalid characters (%1).").arg(id);
}
bool ModelNode::hasId() const