QmlDesigner: Add GridView to ListModelEditor

We could simply test for the model property but this can lead to strange
behaviour.

Change-Id: I4e326890fb02d312b5210089c957dce026a09f94
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Marco Bubke
2020-09-17 10:14:28 +02:00
committed by Thomas Hartmann
parent 0198aca205
commit fc9ad36e40

View File

@@ -368,8 +368,10 @@ public:
static bool isListViewInBaseState(const SelectionContext &selectionState) static bool isListViewInBaseState(const SelectionContext &selectionState)
{ {
return selectionState.isInBaseState() && selectionState.singleNodeIsSelected() return selectionState.isInBaseState() && selectionState.singleNodeIsSelected()
&& selectionState.currentSingleSelectedNode().metaInfo().isSubclassOf( && (selectionState.currentSingleSelectedNode().metaInfo().isSubclassOf(
"QtQuick.ListView"); "QtQuick.ListView")
|| selectionState.currentSingleSelectedNode().metaInfo().isSubclassOf(
"QtQuick.GridView"));
} }
bool isEnabled(const SelectionContext &) const override { return true; } bool isEnabled(const SelectionContext &) const override { return true; }