diff options
author | Michal Klocek <michal.klocek@qt.io> | 2023-03-17 10:34:53 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-03-22 12:48:41 +0000 |
commit | 7d9805df3a471e7172bf72ff1bc08c63ccfd67fa (patch) | |
tree | fee4dca1f5f8991c2b1d5736da38ac072ee3cbad /tests | |
parent | 37b04eeb90063b9845d4b6154fa3bc7e36ebdf0c (diff) | |
download | qtwebengine-7d9805df3a471e7172bf72ff1bc08c63ccfd67fa.tar.gz |
Move quick minimal example to manual tests
Task-number: QTBUG-108751
Change-Id: I0998c46f051908855e0406e5fc7c0a422dc3eef0
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit ed76eef004dbac15f4740d33d06d2b271bf770d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manual/examples/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/manual/examples/quick/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/manual/examples/quick/minimal/CMakeLists.txt | 36 | ||||
-rw-r--r-- | tests/manual/examples/quick/minimal/main.cpp | 19 | ||||
-rw-r--r-- | tests/manual/examples/quick/minimal/main.qml | 16 | ||||
-rw-r--r-- | tests/manual/examples/quick/minimal/minimal.pro | 10 | ||||
-rw-r--r-- | tests/manual/examples/quick/minimal/qml.qrc | 6 |
7 files changed, 89 insertions, 0 deletions
diff --git a/tests/manual/examples/CMakeLists.txt b/tests/manual/examples/CMakeLists.txt index 6e0b301ad..6c9b56c43 100644 --- a/tests/manual/examples/CMakeLists.txt +++ b/tests/manual/examples/CMakeLists.txt @@ -1 +1,2 @@ add_subdirectory(widgets) +add_subdirectory(quick) diff --git a/tests/manual/examples/quick/CMakeLists.txt b/tests/manual/examples/quick/CMakeLists.txt new file mode 100644 index 000000000..d853ba634 --- /dev/null +++ b/tests/manual/examples/quick/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(minimal) diff --git a/tests/manual/examples/quick/minimal/CMakeLists.txt b/tests/manual/examples/quick/minimal/CMakeLists.txt new file mode 100644 index 000000000..39aaa1ea3 --- /dev/null +++ b/tests/manual/examples/quick/minimal/CMakeLists.txt @@ -0,0 +1,36 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(minimal LANGUAGES CXX) + find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineQuick) +endif() + +qt_internal_add_manual_test(webengine-minimal-qml + SOURCES + main.cpp +) + +set_target_properties(webengine-minimal-qml PROPERTIES + WIN32_EXECUTABLE TRUE + MACOSX_BUNDLE TRUE +) + +target_link_libraries(webengine-minimal-qml PUBLIC + Qt::Core + Qt::Gui + Qt::WebEngineQuick +) + +# Resources: +set(qml_resource_files + "main.qml" +) + +qt_add_resources(webengine-minimal-qml "qml" + PREFIX + "/" + FILES + ${qml_resource_files} +) diff --git a/tests/manual/examples/quick/minimal/main.cpp b/tests/manual/examples/quick/minimal/main.cpp new file mode 100644 index 000000000..16466ae06 --- /dev/null +++ b/tests/manual/examples/quick/minimal/main.cpp @@ -0,0 +1,19 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#include <QGuiApplication> +#include <QQmlApplicationEngine> +#include <QtWebEngineQuick/qtwebenginequickglobal.h> + +int main(int argc, char *argv[]) +{ + QCoreApplication::setOrganizationName("QtExamples"); + QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); + QtWebEngineQuick::initialize(); + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + + return app.exec(); +} diff --git a/tests/manual/examples/quick/minimal/main.qml b/tests/manual/examples/quick/minimal/main.qml new file mode 100644 index 000000000..a8733a8c8 --- /dev/null +++ b/tests/manual/examples/quick/minimal/main.qml @@ -0,0 +1,16 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Window +import QtWebEngine + +Window { + width: 1024 + height: 750 + visible: true + WebEngineView { + anchors.fill: parent + url: "https://www.qt.io" + } +} diff --git a/tests/manual/examples/quick/minimal/minimal.pro b/tests/manual/examples/quick/minimal/minimal.pro new file mode 100644 index 000000000..acca6477c --- /dev/null +++ b/tests/manual/examples/quick/minimal/minimal.pro @@ -0,0 +1,10 @@ +TEMPLATE = app + +QT += webenginequick + +SOURCES += main.cpp + +RESOURCES += qml.qrc + +target.path = $$[QT_INSTALL_EXAMPLES]/webenginequick/minimal +INSTALLS += target diff --git a/tests/manual/examples/quick/minimal/qml.qrc b/tests/manual/examples/quick/minimal/qml.qrc new file mode 100644 index 000000000..0ff3892d9 --- /dev/null +++ b/tests/manual/examples/quick/minimal/qml.qrc @@ -0,0 +1,6 @@ +<RCC> + <qresource prefix="/"> + <file>main.qml</file> + </qresource> +</RCC> + |