forked from qt-creator/qt-creator
QmlDesigner.MetaInfo: adding isView()
This function checks if the type is a view. Change-Id: I5b333ac18dd8169bc014c92bd04c0faff4f3f72f Reviewed-by: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
@@ -99,6 +99,7 @@ public:
|
|||||||
bool isSubclassOf(const TypeName &type, int majorVersion, int minorVersio) const;
|
bool isSubclassOf(const TypeName &type, int majorVersion, int minorVersio) const;
|
||||||
|
|
||||||
bool isLayoutable() const;
|
bool isLayoutable() const;
|
||||||
|
bool isView() const;
|
||||||
|
|
||||||
QString importDirectoryPath() const;
|
QString importDirectoryPath() const;
|
||||||
|
|
||||||
|
@@ -1307,4 +1307,12 @@ bool NodeMetaInfo::isLayoutable() const
|
|||||||
return isSubclassOf("QtQuick.Positioner", -1, -1) || isSubclassOf("QtQuick.Layouts.Layout", -1, -1);
|
return isSubclassOf("QtQuick.Positioner", -1, -1) || isSubclassOf("QtQuick.Layouts.Layout", -1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool NodeMetaInfo::isView() const
|
||||||
|
{
|
||||||
|
return isValid() &&
|
||||||
|
(isSubclassOf("QtQuick.ListView", -1, -1) ||
|
||||||
|
isSubclassOf("QtQuick.GridView", -1, -1) ||
|
||||||
|
isSubclassOf("QtQuick.PathView", -1, -1));
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
Reference in New Issue
Block a user