Commit 4a7cf0c6 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.StatesEditor: Do not allow adding states to Window



We only checked for ApplicationWindow. Instead of ApplicationWindow
we have to check for Window. ApplicationWindow is derived from Window.

Change-Id: I5d287af4284e31dcd77e06b498c5ae61dc348ad6
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent e6f86857
......@@ -83,7 +83,7 @@ void StatesEditorView::propertiesAboutToBeRemoved(const QList<AbstractProperty>
void StatesEditorView::rootNodeTypeChanged(const QString &/*type*/, int /*majorVersion*/, int /*minorVersion*/)
{
checkForApplicationWindow();
checkForWindow();
}
void StatesEditorView::instancePropertyChange(const QList<QPair<ModelNode, PropertyName> > &/*propertyList*/)
......@@ -249,10 +249,10 @@ void StatesEditorView::duplicateCurrentState()
setCurrentState(newState);
}
void StatesEditorView::checkForApplicationWindow()
void StatesEditorView::checkForWindow()
{
if (m_statesEditorWidget)
m_statesEditorWidget->showAddNewStatesButton(!rootModelNode().metaInfo().isSubclassOf("QtQuick.Controls.ApplicationWindow", -1, -1));
m_statesEditorWidget->showAddNewStatesButton(!rootModelNode().metaInfo().isSubclassOf("QtQuick.Window.Window", -1, -1));
}
void StatesEditorView::setCurrentState(const QmlModelState &state)
......@@ -320,7 +320,7 @@ void StatesEditorView::modelAttached(Model *model)
if (m_statesEditorWidget)
m_statesEditorWidget->setNodeInstanceView(nodeInstanceView());
checkForApplicationWindow();
checkForWindow();
resetModel();
}
......
......@@ -113,7 +113,7 @@ private:
void resetModel();
void addState();
void duplicateCurrentState();
void checkForApplicationWindow();
void checkForWindow();
private:
QWeakPointer<StatesEditorModel> m_statesEditorModel;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment