Commit f376e99c authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.StatesEditor: Simplify code for adding a new state

We should not have to list all supported version of Qt Quick here.
This also fixes adding states for Qt Quick 2.2.

Change-Id: I9cae15a3c20b2f9540322de2caece830c76cd027
Reviewed-by: default avatarThomas Hartmann <>
parent 27fe5df1
......@@ -204,10 +204,7 @@ void StatesEditorView::addState()
try {
if ((rootStateGroup().allStates().count() < 1) && //QtQuick import might be missing
(!model()->hasImport(Import::createLibraryImport("QtQuick", "1.0"), true)
&& !model()->hasImport(Import::createLibraryImport("QtQuick", "1.1"), true)
&& !model()->hasImport(Import::createLibraryImport("QtQuick", "2.0"), true)
&& !model()->hasImport(Import::createLibraryImport("QtQuick", "2.1"), true)))
(!model()->hasImport(Import::createLibraryImport("QtQuick", "1.0"), true, true)))
model()->changeImports(QList<Import>() << Import::createLibraryImport("QtQuick", "1.0"), QList<Import>());
ModelNode newState = rootStateGroup().addState(newStateName);
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