diff options
Diffstat (limited to 'examples/webenginewidgets/minimal')
-rw-r--r-- | examples/webenginewidgets/minimal/CMakeLists.txt | 33 | ||||
-rw-r--r-- | examples/webenginewidgets/minimal/doc/images/minimal-example.png | bin | 89294 -> 0 bytes | |||
-rw-r--r-- | examples/webenginewidgets/minimal/doc/src/minimal.qdoc | 55 | ||||
-rw-r--r-- | examples/webenginewidgets/minimal/main.cpp | 28 | ||||
-rw-r--r-- | examples/webenginewidgets/minimal/minimal.pro | 8 |
5 files changed, 0 insertions, 124 deletions
diff --git a/examples/webenginewidgets/minimal/CMakeLists.txt b/examples/webenginewidgets/minimal/CMakeLists.txt deleted file mode 100644 index 7c1cac1d8..000000000 --- a/examples/webenginewidgets/minimal/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -cmake_minimum_required(VERSION 3.16) -project(minimal LANGUAGES CXX) - -set(CMAKE_AUTOMOC ON) - -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginewidgets/minimal-widgets") - -find_package(Qt6 REQUIRED COMPONENTS Core Gui WebEngineWidgets) - -qt_add_executable(minimal-widgets - main.cpp -) - -set_target_properties(minimal-widgets PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) - -target_link_libraries(minimal-widgets PUBLIC - Qt::Core - Qt::Gui - Qt::WebEngineWidgets -) - -install(TARGETS minimal-widgets - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" -) diff --git a/examples/webenginewidgets/minimal/doc/images/minimal-example.png b/examples/webenginewidgets/minimal/doc/images/minimal-example.png Binary files differdeleted file mode 100644 index 18ac9b177..000000000 --- a/examples/webenginewidgets/minimal/doc/images/minimal-example.png +++ /dev/null diff --git a/examples/webenginewidgets/minimal/doc/src/minimal.qdoc b/examples/webenginewidgets/minimal/doc/src/minimal.qdoc deleted file mode 100644 index 5fb5f8be3..000000000 --- a/examples/webenginewidgets/minimal/doc/src/minimal.qdoc +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! - \example webenginewidgets/minimal - \title WebEngine Widgets Minimal Example - \ingroup webengine-widgetexamples - \brief Displays a web page using \QWE Widgets. - - \image minimal-example.png - - \e {WebEngine Widgets Minimal Example} demonstrates how to use - \l{QWebEngineView} to render a web page. It shows the minimum amount of code - needed to load and display an HTML page, and can be used as a basis for - further experimentation. - - \include examples-run.qdocinc - - \section1 The Code - - We first define a \c commandLineUrlArgument function that returns the URL to open. - This is either the first positional argument given on the command line, or - \c https://www.qt.io as a fallback. - - \quotefromfile webenginewidgets/minimal/main.cpp - \skipto #include - - \printto int main - - In the \c main function we first set the - \l{QCoreApplication::organizationName} property. This affects the locations - where \QWE stores persistent and cached data (see also - \l{QWebEngineProfile::cachePath} and - \l{QWebEngineProfile::persistentStoragePath}). - - Next, we instantiate a QApplication and a QWebEngineView. The URL - to load is taken from \c commandLineUrlArgument and - loaded by calling \l QWebEngineView::setUrl. The view widget is - given a reasonable default size, and shown. - Finally, QApplication::exec() launches the main event loop. - - \printuntil } - - \section1 Requirements - - The example requires a working internet connection to render - the \l{Qt Homepage}. - An optional system proxy should be picked up automatically. - However, for proxies that require a username or password, - you need to connect to - QWebEnginePage::proxyAuthenticationRequired. - - \l{Qt WebEngine Widgets} uses the \l{Qt Quick Scene Graph} to compose the - page. Therefore, OpenGL support is required. -*/ diff --git a/examples/webenginewidgets/minimal/main.cpp b/examples/webenginewidgets/minimal/main.cpp deleted file mode 100644 index 86c04e721..000000000 --- a/examples/webenginewidgets/minimal/main.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#include <QApplication> -#include <QWebEngineView> - -QUrl commandLineUrlArgument() -{ - const QStringList args = QCoreApplication::arguments(); - for (const QString &arg : args.mid(1)) { - if (!arg.startsWith(QLatin1Char('-'))) - return QUrl::fromUserInput(arg); - } - return QUrl(QStringLiteral("https://www.qt.io")); -} - -int main(int argc, char *argv[]) -{ - QCoreApplication::setOrganizationName("QtExamples"); - QApplication app(argc, argv); - - QWebEngineView view; - view.setUrl(commandLineUrlArgument()); - view.resize(1024, 750); - view.show(); - - return app.exec(); -} diff --git a/examples/webenginewidgets/minimal/minimal.pro b/examples/webenginewidgets/minimal/minimal.pro deleted file mode 100644 index 849f4b9b6..000000000 --- a/examples/webenginewidgets/minimal/minimal.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE = app - -QT += webenginewidgets - -SOURCES += main.cpp - -target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/minimal -INSTALLS += target |