forked from qt-creator/qt-creator
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:
@@ -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();
|
||||
}
|
||||
|
@@ -93,7 +93,7 @@ private:
|
||||
void resetModel();
|
||||
void addState();
|
||||
void duplicateCurrentState();
|
||||
void checkForWindow();
|
||||
void checkForStatesAvailability();
|
||||
|
||||
private:
|
||||
QPointer<StatesEditorModel> m_statesEditorModel;
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user