summaryrefslogtreecommitdiffstats
path: root/tests/quicktestbrowser/main.cpp
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2023-01-31 09:17:19 +0100
committerPeter Varga <pvarga@inf.u-szeged.hu>2023-02-02 10:55:34 +0100
commit756b8d63ac1710dc3661c1900a0a90ae3b0db926 (patch)
tree628aac8e82f0c486e2fafb67160e179b1a99ace2 /tests/quicktestbrowser/main.cpp
parentc9852591cb8ccedfcdf0469db04be59671a912e9 (diff)
Remove quicktestbrowser
It is not maintained for a while and most probably also not used because it is not working since Qt6. QuickNanoBrowser example should be used instead, because it implements most of the quicktestbrowser features. Pick-to: 6.5 Change-Id: I330e1c6e0f4bf81c0bce0e6d70d47a513f63d8c7 Reviewed-by: Michal Klocek <michal.klocek@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/quicktestbrowser/main.cpp')
-rw-r--r--tests/quicktestbrowser/main.cpp71
1 files changed, 0 insertions, 71 deletions
diff --git a/tests/quicktestbrowser/main.cpp b/tests/quicktestbrowser/main.cpp
deleted file mode 100644
index c41eb2f56..000000000
--- a/tests/quicktestbrowser/main.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-
-#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 <QtQml/QQmlComponent>
-#include <QtWebEngineQuick/qtwebenginequickglobal.h>
-#include <QtWebEngineQuick/QQuickWebEngineProfile>
-#include <QtWebEngineCore/qwebenginecookiestore.h>
-
-static QUrl startupUrl()
-{
- QUrl ret;
- QStringList args(qApp->arguments());
- args.takeFirst();
- for (const QString &arg : std::as_const(args)) {
- if (arg.startsWith(QLatin1Char('-')))
- continue;
- ret = Utils::fromUserInput(arg);
- if (ret.isValid())
- return ret;
- }
- return QUrl(QStringLiteral("http://qt.io/"));
-}
-
-int main(int argc, char **argv)
-{
- Application app(argc, argv);
-
- // Enable dev tools by default for the test browser
- if (qgetenv("QTWEBENGINE_REMOTE_DEBUGGING").isNull())
- qputenv("QTWEBENGINE_REMOTE_DEBUGGING", "1337");
- QtWebEngineQuick::initialize();
-
- QQmlApplicationEngine appEngine;
- Utils utils;
- appEngine.rootContext()->setContextProperty("utils", &utils);
- appEngine.load(QUrl("qrc:/ApplicationRoot.qml"));
-
- QObject *rootObject = appEngine.rootObjects().first();
-
- QQuickWebEngineProfile *profile = new QQuickWebEngineProfile(rootObject);
-
- const QMetaObject *rootMeta = rootObject->metaObject();
- int index = rootMeta->indexOfProperty("thirdPartyCookiesEnabled");
- Q_ASSERT(index != -1);
- QMetaProperty thirdPartyCookiesProperty = rootMeta->property(index);
- profile->cookieStore()->setCookieFilter(
- [rootObject,&thirdPartyCookiesProperty](const QWebEngineCookieStore::FilterRequest &request)
- {
- return !request.thirdParty || thirdPartyCookiesProperty.read(rootObject).toBool();
- });
-
- index = rootMeta->indexOfProperty("testProfile");
- Q_ASSERT(index != -1);
- QMetaProperty profileProperty = rootMeta->property(index);
- profileProperty.write(rootObject, QVariant::fromValue(profile));
-
- QMetaObject::invokeMethod(rootObject, "load", Q_ARG(QVariant, startupUrl()));
-
- return app.exec();
-}