Commit 9df3d850 authored by Alessandro Portale's avatar Alessandro Portale

Qt Quick Control Application: Optional QtWidget dependency

Let the user chose whether "native styling" via QWidgets/QApplication
should be enabled or not.

Change-Id: I5eaa7b3a94d5361e62ebce61ff6b7b9216e15b80
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 1d31955a
TEMPLATE = app
@if %{UseQApplication}
QT += qml quick widgets
@else
QT += qml quick
@endif
SOURCES += %{MainCppFileName}
......
%{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")));
......
......@@ -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
}
}
]
},
......
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