Commit dbe4e322 authored by Tobias Hunger's avatar Tobias Hunger

QML wizards: Do not offer .ui.qml files for Qt 5.3

Qt 5.3 is the only version we are going to support that does
not offer ui.qml file support. So just check for the QtQuick
version shipped in Qt 5.3 to decide whether or not to display
the checkbox.

Task-number: QTCREATORBUG-14712
Change-Id: Ibb2204f2bcff819b749e1ed744c14a2e96769351
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@theqtcompany.com>
parent 89bc1fc4
......@@ -4,7 +4,7 @@ import QtQuick.Window %{QtQuickWindowVersion}
Window {
visible: true
@if %{QmlUISplit}
@if %{IsUiFileInUse}
MainForm {
anchors.fill: parent
mouseArea.onClicked: {
......
<RCC>
<qresource prefix="/">
<file>main.qml</file>
@if %{QmlUISplit}
@if %{IsUiFileInUse}
<file>MainForm.ui.qml</file>
@endif
</qresource>
......
......@@ -16,7 +16,9 @@
{ "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" },
{ "key": "QtQuickVersion", "value": "%{JS: %{QtVersion}.qtQuickVersion}" },
{ "key": "QtQuickWindowVersion", "value": "%{JS: %{QtVersion}.qtQuickWindowVersion}" },
{ "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }
{ "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" },
{ "key": "UiSupport", "value": "%{JS: '%{QtQuickVersion}' !== '2.3' }" },
{ "key": "IsUiFileInUse", "value": "%{JS: %{UiSupport} && %{QmlUiSplit} }" }
],
"pages":
......@@ -69,12 +71,13 @@
}
},
{
"name": "QmlUISplit",
"name": "QmlUiSplit",
"trDisplayName": "With ui.qml file",
"type": "CheckBox",
"visible": "%{UiSupport}",
"data":
{
"checked": false
"checked": true
}
}
]
......@@ -115,7 +118,7 @@
},
{
"source": "MainForm.ui.qml",
"condition": "%{QmlUISplit}"
"condition": "%{IsUiFileInUse}"
},
{
"source": "qml.qrc"
......
import QtQuick %{QtQuickVersion}
import QtQuick.Controls %{QtQuickControlsVersion}
@if %{QmlUISplit}
@if %{IsUiFileInUse}
import QtQuick.Dialogs %{QtQuickDialogsVersion}
@endif
......@@ -24,7 +24,7 @@ ApplicationWindow {
}
}
@if %{QmlUISplit}
@if %{IsUiFileInUse}
MainForm {
anchors.fill: parent
button1.onClicked: messageDialog.show(qsTr("Button 1 pressed"))
......
<RCC>
<qresource prefix="/">
<file>main.qml</file>
@if %{QmlUISplit}
@if %{IsUiFileInUse}
<file>MainForm.ui.qml</file>
@endif
</qresource>
......
......@@ -18,7 +18,9 @@
{ "key": "QtQuickControlsVersion", "value": "%{JS: %{QtVersion}.qtQuickControlsVersion}" },
{ "key": "QtQuickDialogsVersion", "value": "%{JS: %{QtVersion}.qtQuickDialogsVersion}" },
{ "key": "QtQuickLayoutsVersion", "value": "%{JS: %{QtVersion}.qtQuickLayoutsVersion}" },
{ "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }
{ "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" },
{ "key": "UiSupport", "value": "%{JS: '%{QtQuickVersion}' !== '2.3' }" },
{ "key": "IsUiFileInUse", "value": "%{JS: %{UiSupport} && %{QmlUiSplit} }" }
],
"pages":
......@@ -77,9 +79,10 @@
}
},
{
"name": "QmlUISplit",
"name": "QmlUiSplit",
"trDisplayName": "With ui.qml file",
"type": "CheckBox",
"visible": "%{UiSupport}",
"data":
{
"checked": true
......@@ -132,7 +135,7 @@
},
{
"source": "MainForm.ui.qml",
"condition": "%{QmlUISplit}"
"condition": "%{IsUiFileInUse}"
},
{
"source": "qml.qrc"
......
......@@ -274,7 +274,7 @@ QString MacroExpander::expand(const QString &stringWithVariables) const
if (d->m_lockDepth == 0)
d->m_aborted = false;
if (d->m_lockDepth > 3) { // Limit recursion.
if (d->m_lockDepth > 10) { // Limit recursion.
d->m_aborted = true;
return QString();
}
......
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