QmlDesigner: Remove redundancy

Remove redudant occurrences of QtQuick.Window.Window/QtQuick.Dialogs.Dialog

Change-Id: I6d3c37f2badfc90d53993d55679e1bc97d70705f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2019-03-20 13:20:00 +01:00
parent 75043690e3
commit 613e15dba6
3 changed files with 6 additions and 14 deletions

View File

@@ -72,7 +72,7 @@ WidgetInfo StatesEditorView::widgetInfo()
void StatesEditorView::rootNodeTypeChanged(const QString &/*type*/, int /*majorVersion*/, int /*minorVersion*/)
{
checkForWindow();
checkForStatesAvailability();
}
void StatesEditorView::toggleStatesViewExpanded()
@@ -200,12 +200,10 @@ void StatesEditorView::duplicateCurrentState()
setCurrentState(newState);
}
void StatesEditorView::checkForWindow()
void StatesEditorView::checkForStatesAvailability()
{
if (m_statesEditorWidget)
m_statesEditorWidget->showAddNewStatesButton(!rootModelNode().metaInfo().isSubclassOf("QtQuick.Window.Window")
&& !rootModelNode().metaInfo().isSubclassOf("QtQuick.Dialogs.Dialog")
&& !rootModelNode().metaInfo().isSubclassOf("QtQuick.Window.Popup"));
m_statesEditorWidget->showAddNewStatesButton(rootModelNode().metaInfo().isSubclassOf("QtQuick.Item"));
}
void StatesEditorView::setCurrentState(const QmlModelState &state)
@@ -315,7 +313,7 @@ void StatesEditorView::modelAttached(Model *model)
if (m_statesEditorWidget)
m_statesEditorWidget->setNodeInstanceView(nodeInstanceView());
checkForWindow();
checkForStatesAvailability();
resetModel();
}

View File

@@ -93,7 +93,7 @@ private:
void resetModel();
void addState();
void duplicateCurrentState();
void checkForWindow();
void checkForStatesAvailability();
private:
QPointer<StatesEditorModel> m_statesEditorModel;

View File

@@ -51,13 +51,7 @@ bool QmlItemNode::isItemOrWindow(const ModelNode &modelNode)
if (modelNode.metaInfo().isSubclassOf("QtQuick.Item"))
return true;
if (modelNode.metaInfo().isSubclassOf("QtQuick.Window.Window") && modelNode.isRootNode())
return true;
if (modelNode.metaInfo().isSubclassOf("QtQuick.Dialogs.Dialog") && modelNode.isRootNode())
return true;
if (modelNode.metaInfo().isSubclassOf("QtQuick.Controls.Popup"))
if (modelNode.metaInfo().isGraphicalItem() && modelNode.isRootNode())
return true;
return false;