forked from qt-creator/qt-creator
QmlDesigner: Add new node hints
Change-Id: I327b9bd714072077bc12085573e63ee2f4b994a8 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -64,9 +64,11 @@ public:
|
||||
bool isStackedContainer() const;
|
||||
bool canBeReparentedTo(const ModelNode &potenialParent);
|
||||
QString indexPropertyForStackedContainer() const;
|
||||
QStringList visibleNonDefaultProperties() const;
|
||||
bool takesOverRenderingOfChildren() const;
|
||||
bool visibleInNavigator() const;
|
||||
bool visibleInLibrary() const;
|
||||
QString forceNonDefaultProperty() const;
|
||||
|
||||
QHash<QString, QString> hints() const;
|
||||
static NodeHints fromModelNode(const ModelNode &modelNode);
|
||||
|
@@ -192,6 +192,19 @@ QString NodeHints::indexPropertyForStackedContainer() const
|
||||
return Internal::evaluateExpression(expression, modelNode(), ModelNode()).toString();
|
||||
}
|
||||
|
||||
QStringList NodeHints::visibleNonDefaultProperties() const
|
||||
{
|
||||
if (!isValid())
|
||||
return {};
|
||||
|
||||
const QString expression = m_hints.value("visibleNonDefaultProperties");
|
||||
|
||||
if (expression.isEmpty())
|
||||
return {};
|
||||
|
||||
return Internal::evaluateExpression(expression, modelNode(), ModelNode()).toString().split(",");
|
||||
}
|
||||
|
||||
bool NodeHints::takesOverRenderingOfChildren() const
|
||||
{
|
||||
if (!isValid())
|
||||
@@ -213,6 +226,16 @@ bool NodeHints::visibleInLibrary() const
|
||||
return evaluateBooleanExpression("visibleInLibrary", true);
|
||||
}
|
||||
|
||||
QString NodeHints::forceNonDefaultProperty() const
|
||||
{
|
||||
const QString expression = m_hints.value("forceNonDefaultProperty");
|
||||
|
||||
if (expression.isEmpty())
|
||||
return {};
|
||||
|
||||
return Internal::evaluateExpression(expression, modelNode(), ModelNode()).toString();
|
||||
}
|
||||
|
||||
QHash<QString, QString> NodeHints::hints() const
|
||||
{
|
||||
return m_hints;
|
||||
|
Reference in New Issue
Block a user