{
    "version": 1,
    "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ],
    "id": "V.QtQuickApplicationScroll",
    "category": "E.ApplicationQtQuick",
    "trDescription": "Creates a Qt Quick Controls application with a ScrollView.",
    "trDisplayName": "Qt Quick Application - Scroll",
    "trDisplayCategory": "Application (Qt Quick)",
    "icon": "icon.png",
    "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.9" ],
    "enabled": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('QbsProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0}",

    "options":
    [
        { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'qmake' ? value('ProFile') : (value('BuildSystem') === 'cmake' ? value('CMakeFile') : value('QbsFile'))}" },
        { "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" },
        { "key": "QbsFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qbs')}" },
        { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" },
        { "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" },
        { "key": "QtQuickVersion", "value": "%{JS: value('QtVersion').QtQuickVersion}" },
        { "key": "QtQuickControlsVersion", "value": "%{JS: value('QtVersion').QtQuickControlsVersion}" },
        { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: value('QtVersion').QtQuickVirtualKeyboardImport}" },
        { "key": "QtQuickControlsStyle", "value": "%{JS: value('ControlsStyle').QtQuickControlsStyle}" },
        { "key": "QtQuickControlsStyleTheme", "value": "%{JS: value('ControlsStyle').QtQuickControlsStyleTheme}" },
        { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" },
        { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0}" },
        { "key": "HasTranslation", "value": "%{JS: value('TsFileName') !== ''}" },
        { "key": "SetQPAPhysicalSize", "value": "%{UseVirtualKeyboardByDefault}" }
    ],

    "pages":
    [
        {
            "trDisplayName": "Project Location",
            "trShortTitle": "Location",
            "typeId": "Project"
        },
        {
            "trDisplayName": "Define Build System",
            "trShortTitle": "Build System",
            "typeId": "Fields",
            "enabled": "%{JS: !value('IsSubproject')}",
            "data":
            [
                {
                    "name": "BuildSystem",
                    "trDisplayName": "Build system:",
                    "type": "ComboBox",
                    "persistenceKey": "BuildSystemType",
                    "data":
                    {
                        "index": 0,
                        "items":
                        [
                            {
                                "trKey": "qmake",
                                "value": "qmake",
                                "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}"
                            },
                            {
                                "trKey": "CMake",
                                "value": "cmake",
                                "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}"
                            },
                            {
                                "trKey": "Qbs",
                                "value": "qbs",
                                "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}"
                            }
                        ]
                    }
                }
            ]
        },
        {
            "trDisplayName": "Define Project Details",
            "trShortTitle": "Details",
            "typeId": "Fields",
            "data":
            [
                {
                    "name": "QtVersion",
                    "trDisplayName": "Minimal required Qt version:",
                    "type": "ComboBox",
                    "persistenceKey": "QtQuick.minimumQtVersion",
                    "data":
                    {
                        "index": 3,
                        "items":
                        [
                            {
                                "trKey": "Qt 5.15",
                                "value":
                                {
                                    "QtQuickVersion": "2.15",
                                    "QtQuickControlsVersion": "2.15",
                                    "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.15"
                                }
                            },
                            {
                                "trKey": "Qt 5.14",
                                "value":
                                {
                                    "QtQuickVersion": "2.14",
                                    "QtQuickControlsVersion": "2.14",
                                    "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.14"
                                }
                            },
                            {
                                "trKey": "Qt 5.13",
                                "value":
                                {
                                    "QtQuickVersion": "2.13",
                                    "QtQuickControlsVersion": "2.13",
                                    "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4"
                                }
                            },
                            {
                                "trKey": "Qt 5.12",
                                "value":
                                {
                                    "QtQuickVersion": "2.12",
                                    "QtQuickControlsVersion": "2.5",
                                    "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4"
                                }
                            },
                            {
                                "trKey": "Qt 5.11",
                                "value":
                                {
                                    "QtQuickVersion": "2.11",
                                    "QtQuickControlsVersion": "2.4",
                                    "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3"
                                }
                            },
                            {
                                "trKey": "Qt 5.10",
                                "value":
                                {
                                    "QtQuickVersion": "2.10",
                                    "QtQuickControlsVersion": "2.3",
                                    "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.3"
                                }
                            },
                            {
                                "trKey": "Qt 5.9",
                                "value":
                                {
                                    "QtQuickVersion": "2.9",
                                    "QtQuickControlsVersion": "2.2",
                                    "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.2"
                                }
                            }
                        ]
                    }
                },
                {
                    "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",
                    "persistenceKey": "QtQuick.UseVirtualKeyboard.%{UseVirtualKeyboardByDefault}",
                    "data":
                    {
                        "checked": "%{UseVirtualKeyboardByDefault}"
                    }
                }
            ]
        },
        {
            "trDisplayName": "Translation File",
            "trShortTitle": "Translation",
            "typeId": "QtTranslation"
        },
        {
            "trDisplayName": "Kit Selection",
            "trShortTitle": "Kits",
            "typeId": "Kits",
            "enabled": "%{JS: !value('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: value('BuildSystem') === 'qmake'}"
                },
                {
                    "source": "../CMakeLists.txt",
                    "target": "CMakeLists.txt",
                    "openAsProject": true,
                    "condition": "%{JS: value('BuildSystem') === 'cmake'}"
                },
                {
                    "source": "../app.qbs",
                    "target": "%{QbsFile}",
                    "openAsProject": true,
                    "condition": "%{JS: value('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": "../../translation.ts",
                    "target": "%{TsFileName}",
                    "condition": "%{HasTranslation}"
                },
                {
                    "source": "../../git.ignore",
                    "target": ".gitignore",
                    "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}"
                }
            ]
        }
    ]
}
