forked from qt-creator/qt-creator
Add interface to check incompatible qml ids
Task-number: QDS-10121 Change-Id: I112bee4e9323dc4eff30ec7a4693c1e9632d6ba9 Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -680,6 +680,11 @@ QList<StaticAnalysis::Type> Check::defaultDisabledMessagesForNonQuickUi()
|
|||||||
return disabled;
|
return disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Check::incompatibleDesignerQmlId(const QString &id)
|
||||||
|
{
|
||||||
|
return idsThatShouldNotBeUsedInDesigner->contains(id);
|
||||||
|
}
|
||||||
|
|
||||||
Check::Check(Document::Ptr doc, const ContextPtr &context, Utils::QtcSettings *qtcSettings)
|
Check::Check(Document::Ptr doc, const ContextPtr &context, Utils::QtcSettings *qtcSettings)
|
||||||
: _doc(doc)
|
: _doc(doc)
|
||||||
, _context(context)
|
, _context(context)
|
||||||
@@ -1099,7 +1104,7 @@ bool Check::visit(UiScriptBinding *ast)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idsThatShouldNotBeUsedInDesigner->contains(id)) {
|
if (incompatibleDesignerQmlId(id)) {
|
||||||
addMessage(ErrInvalidIdeInVisualDesigner, loc);
|
addMessage(ErrInvalidIdeInVisualDesigner, loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -39,6 +39,7 @@ public:
|
|||||||
|
|
||||||
static QList<StaticAnalysis::Type> defaultDisabledMessages();
|
static QList<StaticAnalysis::Type> defaultDisabledMessages();
|
||||||
static QList<StaticAnalysis::Type> defaultDisabledMessagesForNonQuickUi();
|
static QList<StaticAnalysis::Type> defaultDisabledMessagesForNonQuickUi();
|
||||||
|
static bool incompatibleDesignerQmlId(const QString &id);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool preVisit(AST::Node *ast) override;
|
bool preVisit(AST::Node *ast) override;
|
||||||
|
Reference in New Issue
Block a user