diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2017-08-01 15:55:02 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2017-08-04 14:41:23 +0000 |
commit | e6bea5c3e20a9476a7f1a61fd468641de95399aa (patch) | |
tree | 5d7d2346eca83007fade40556385ed6c948cc859 /share | |
parent | 090278b0976e685bfe33cdfec0d2f2a73a038899 (diff) | |
download | qt-creator-e6bea5c3e20a9476a7f1a61fd468641de95399aa.tar.gz |
Wizards: Add a Qt Quick Controls 2 "Scroll" wizard
Creates a Qt Quick Controls 2 application with a ScrollView to display.
Change-Id: I6367b8d39eea632469f62f1fc1b99790121ff00e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'share')
-rw-r--r-- | share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/icon.png (renamed from share/qtcreator/templates/wizards/projects/qtquickapplication/icon-scroll.png) | bin | 573 -> 573 bytes | |||
-rw-r--r-- | share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/icon@2x.png (renamed from share/qtcreator/templates/wizards/projects/qtquickapplication/icon-scroll@2x.png) | bin | 1095 -> 1095 bytes | |||
-rw-r--r-- | share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/main.qml.tpl | 59 | ||||
-rw-r--r-- | share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/qml.qrc | 6 | ||||
-rw-r--r-- | share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json | 252 |
5 files changed, 317 insertions, 0 deletions
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/icon-scroll.png b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/icon.png Binary files differindex 7d0267a603..7d0267a603 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/icon-scroll.png +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/icon.png diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/icon-scroll@2x.png b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/icon@2x.png Binary files differindex 27004e6468..27004e6468 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/icon-scroll@2x.png +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/icon@2x.png diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/main.qml.tpl b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/main.qml.tpl new file mode 100644 index 0000000000..da4fdc8c2c --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/main.qml.tpl @@ -0,0 +1,59 @@ +import QtQuick %{QtQuickVersion} +import QtQuick.Controls %{QtQuickControlsVersion} +@if %{UseVirtualKeyboard} +import %{QtQuickVirtualKeyboardImport} +@endif + +ApplicationWindow { +@if %{UseVirtualKeyboard} + id: window +@endif + visible: true + width: 640 + height: 480 + title: qsTr("Scroll") + + ScrollView { + anchors.fill: parent + + ListView { + width: parent.width + model: 20 + delegate: ItemDelegate { + text: "Item " + (index + 1) + width: parent.width + } + } + } +@if %{UseVirtualKeyboard} + + InputPanel { + id: inputPanel + z: 99 + x: 0 + y: window.height + width: window.width + + states: State { + name: "visible" + when: inputPanel.active + PropertyChanges { + target: inputPanel + y: window.height - inputPanel.height + } + } + transitions: Transition { + from: "" + to: "visible" + reversible: true + ParallelAnimation { + NumberAnimation { + properties: "y" + duration: 250 + easing.type: Easing.InOutQuad + } + } + } + } +@endif +} diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/qml.qrc b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/qml.qrc new file mode 100644 index 0000000000..af1cc9bc02 --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/qml.qrc @@ -0,0 +1,6 @@ +<RCC> + <qresource prefix="/"> + <file>main.qml</file> + <file>qtquickcontrols2.conf</file> + </qresource> +</RCC> diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json new file mode 100644 index 0000000000..7358a6769f --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json @@ -0,0 +1,252 @@ +{ + "version": 1, + "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ], + "id": "V.QtQuickApplicationScroll", + "category": "F.Application", + "trDescription": "Creates a Qt Quick Controls application with a ScrollView.", + "trDisplayName": "Qt Quick Application - Scroll", + "trDisplayCategory": "Application", + "icon": "icon.png", + "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.9" ], + "enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('QbsProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}", + + "options": + [ + { "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : ('%{BuildSystem}' === 'cmake' ? '%{CMakeFile}' : '%{QbsFile}')}" }, + { "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, + { "key": "QbsFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" }, + { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, + { "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" }, + { "key": "QtQuickVersion", "value": "%{JS: %{QtVersion}.QtQuickVersion}" }, + { "key": "QtQuickControlsVersion", "value": "%{JS: %{QtVersion}.QtQuickControlsVersion}" }, + { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: %{QtVersion}.QtQuickVirtualKeyboardImport}" }, + { "key": "QtQuickControlsStyle", "value": "%{JS: %{ControlsStyle}.QtQuickControlsStyle}" }, + { "key": "QtQuickControlsStyleTheme", "value": "%{JS: %{ControlsStyle}.QtQuickControlsStyleTheme}" }, + { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }, + { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: [ %{Plugins} ].indexOf('Boot2Qt') >= 0 || [ %{Plugins} ].indexOf('Boot2QtQdb') >= 0}" }, + { "key": "SetQPAPhysicalSize", "value": "%{UseVirtualKeyboardByDefault}" } + ], + + "pages": + [ + { + "trDisplayName": "Project Location", + "trShortTitle": "Location", + "typeId": "Project" + }, + { + "trDisplayName": "Define Build System", + "trShortTitle": "Build System", + "typeId": "Fields", + "enabled": "%{JS: ! %{IsSubproject}}", + "data": + [ + { + "name": "BuildSystem", + "trDisplayName": "Build system:", + "type": "ComboBox", + "data": + { + "index": 0, + "items": + [ + { + "trKey": "qmake", + "value": "qmake", + "condition": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0}" + }, + { + "trKey": "CMake", + "value": "cmake", + "condition": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}" + }, + { + "trKey": "Qbs", + "value": "qbs", + "condition": "%{JS: [ %{Plugins} ].indexOf('QbsProjectManager') >= 0}" + } + ] + } + } + ] + }, + { + "trDisplayName": "Define Project Details", + "trShortTitle": "Details", + "typeId": "Fields", + "data": + [ + { + "name": "QtVersion", + "trDisplayName": "Minimal required Qt version:", + "type": "ComboBox", + "visible": false, + "data": + { + "index": 0, + "items": + [ + { + "trKey": "Qt 5.9", + "value": + "{ + 'QtQuickVersion': '2.9', + 'QtQuickControlsVersion': '2.2', + 'QtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1' + }" + } + ] + } + }, + { + "name": "ControlsStyle", + "trDisplayName": "Qt Quick Controls Style:", + "type": "ComboBox", + "data": + { + "index": 0, + "items": + [ + { + "trKey": "Default", + "value": + "{ + 'QtQuickControlsStyle': 'Default', + 'QtQuickControlsStyleTheme': '' + }" + }, + { + "trKey": "Material Light", + "value": + "{ + 'QtQuickControlsStyle': 'Material', + 'QtQuickControlsStyleTheme': 'Light' + }" + }, + { + "trKey": "Material Dark", + "value": + "{ + 'QtQuickControlsStyle': 'Material', + 'QtQuickControlsStyleTheme': 'Dark' + }" + }, + { + "trKey": "Universal Light", + "value": + "{ + 'QtQuickControlsStyle': 'Universal', + 'QtQuickControlsStyleTheme': 'Light' + }" + }, + { + "trKey": "Universal Dark", + "value": + "{ + 'QtQuickControlsStyle': 'Universal', + 'QtQuickControlsStyleTheme': 'Dark' + }" + }, + { + "trKey": "Universal System", + "value": + "{ + 'QtQuickControlsStyle': 'Universal', + 'QtQuickControlsStyleTheme': 'System' + }" + }, + { + "trKey": "Fusion (Qt 5.10+)", + "value": + "{ + 'QtQuickControlsStyle': 'Fusion', + 'QtQuickControlsStyleTheme': '' + }" + }, + { + "trKey": "Imagine (Qt 5.10+)", + "value": + "{ + 'QtQuickControlsStyle': 'Imagine', + 'QtQuickControlsStyleTheme': '' + }" + } + ] + } + }, + { + "name": "UseVirtualKeyboard", + "trDisplayName": "Use Qt Virtual Keyboard.", + "type": "CheckBox", + "data": + { + "checked": "%{JS: %{UseVirtualKeyboardByDefault}}" + } + } + ] + }, + { + "trDisplayName": "Kit Selection", + "trShortTitle": "Kits", + "typeId": "Kits", + "enabled": "%{JS: ! %{IsSubproject}}", + "data": { + "projectFilePath": "%{ProjectFile}", + "requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "%{QtQuickFeature}" ] + } + }, + { + "trDisplayName": "Project Management", + "trShortTitle": "Summary", + "typeId": "Summary" + } + ], + "generators": + [ + { + "typeId": "File", + "data": + [ + { + "source": "../app.pro", + "target": "%{ProFile}", + "openAsProject": true, + "condition": "%{JS: '%{BuildSystem}' === 'qmake'}" + }, + { + "source": "../CMakeLists.txt", + "target": "CMakeLists.txt", + "openAsProject": true, + "condition": "%{JS: '%{BuildSystem}' === 'cmake'}" + }, + { + "source": "../app.qbs", + "target": "%{QbsFile}", + "openAsProject": true, + "condition": "%{JS: '%{BuildSystem}' === 'qbs'}" + }, + { + "source": "../main.cpp", + "target": "%{MainCppFileName}" + }, + { + "source": "main.qml.tpl", + "target": "main.qml", + "openInEditor": true + }, + { + "source": "../qtquickcontrols2.conf", + "target": "qtquickcontrols2.conf" + }, + { + "source": "qml.qrc" + }, + { + "source": "../git.ignore", + "target": ".gitignore", + "condition": "%{JS: !%{IsSubproject} && '%{VersionControl}' === 'G.Git'}" + } + ] + } + ] +} |