diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/app.pro b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/app.pro index 25c9afc27e7..201cfb0ee77 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/app.pro +++ b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/app.pro @@ -1,6 +1,10 @@ TEMPLATE = app +@if %{UseQApplication} QT += qml quick widgets +@else +QT += qml quick +@endif SOURCES += %{MainCppFileName} diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/main.cpp b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/main.cpp index 6ea3921b635..cb3ea7209aa 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/main.cpp +++ b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/main.cpp @@ -1,8 +1,12 @@ %{Cpp:LicenseTemplate}\ -%{JS: QtSupport.qtIncludes([], ["QWidgets/QApplication", "QQml/QQmlApplicationEngine"])} +%{JS: QtSupport.qtIncludes([], [%{UseQApplication} ? "QWidgets/QApplication" : "QtGui/QGuiApplication", "QQml/QQmlApplicationEngine"])} int main(int argc, char *argv[]) { +@if %{UseQApplication} QApplication app(argc, argv); +@else + QGuiApplication app(argc, argv); +@endif QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/wizard.json index f50e5e80b93..6de9493f6ec 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/wizard.json @@ -84,6 +84,17 @@ "uncheckedValue": false, "checked": true } + }, + { + "name": "UseQApplication", + "trDisplayName": "Enable native styling. Requires dependency on the QtWidgets module.", + "type": "CheckBox", + "data": + { + "checkedValue": true, + "uncheckedValue": false, + "checked": true + } } ] },