summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-09-23 13:32:00 +0200
committerMichal Klocek <michal.klocek@qt.io>2021-09-27 22:08:22 +0200
commit7405ce9412e6b0bc70b2051734668c8ecca4ceb2 (patch)
treecd4671e63f252385ded3c3f61bac81d03bb411e4 /examples
parent31db7f6a192f0ffbbadfe49997df0d64a1ead6ae (diff)
Do not require widgets for quick examples
We needed widgets to get qqc1 styling, since we now use only qqc2 drop that requirement. Fixes: QTBUG-96771 Task-number: QTBUG-95367 Pick-to: 6.2 Change-Id: I7338cd04885069169fef1c4bca17e0777b11de8c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/webenginequick/customdialogs/CMakeLists.txt1
-rw-r--r--examples/webenginequick/customdialogs/main.cpp10
-rw-r--r--examples/webenginequick/quicknanobrowser/main.cpp8
3 files changed, 2 insertions, 17 deletions
diff --git a/examples/webenginequick/customdialogs/CMakeLists.txt b/examples/webenginequick/customdialogs/CMakeLists.txt
index ce37f3725..bd1810931 100644
--- a/examples/webenginequick/customdialogs/CMakeLists.txt
+++ b/examples/webenginequick/customdialogs/CMakeLists.txt
@@ -16,7 +16,6 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginequick/customdialogs")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS WebEngineQuick)
-find_package(Qt6 OPTIONAL_COMPONENTS Widgets)
qt_add_executable(customdialogs
main.cpp
diff --git a/examples/webenginequick/customdialogs/main.cpp b/examples/webenginequick/customdialogs/main.cpp
index 463da44f6..6ed5771f1 100644
--- a/examples/webenginequick/customdialogs/main.cpp
+++ b/examples/webenginequick/customdialogs/main.cpp
@@ -53,22 +53,14 @@
#include <QNetworkProxy>
#include <QQmlApplicationEngine>
#include <QTimer>
-
-#ifndef QT_NO_WIDGETS
-#include <QtWidgets/QApplication>
-// QApplication is required to get native styling with QtQuickControls
-typedef QApplication Application;
-#else
#include <QtGui/QGuiApplication>
-typedef QGuiApplication Application;
-#endif
int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationName("QtExamples");
QtWebEngineQuick::initialize();
- Application app(argc, argv);
+ QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
Server *server = new Server(&engine);
diff --git a/examples/webenginequick/quicknanobrowser/main.cpp b/examples/webenginequick/quicknanobrowser/main.cpp
index 859856d92..f21b0362c 100644
--- a/examples/webenginequick/quicknanobrowser/main.cpp
+++ b/examples/webenginequick/quicknanobrowser/main.cpp
@@ -50,13 +50,7 @@
#include "utils.h"
-#ifndef QT_NO_WIDGETS
-#include <QtWidgets/QApplication>
-typedef QApplication Application;
-#else
#include <QtGui/QGuiApplication>
-typedef QGuiApplication Application;
-#endif
#include <QtQml/QQmlApplicationEngine>
#include <QtQml/QQmlContext>
#include <QtWebEngineQuick/qtwebenginequickglobal.h>
@@ -81,7 +75,7 @@ int main(int argc, char **argv)
QCoreApplication::setOrganizationName("QtExamples");
QtWebEngineQuick::initialize();
- Application app(argc, argv);
+ QGuiApplication app(argc, argv);
QQmlApplicationEngine appEngine;
Utils utils;