diff options
Diffstat (limited to 'src/webenginewidgets/doc')
8 files changed, 42 insertions, 49 deletions
diff --git a/src/webenginewidgets/doc/snippets/push-notifications/commands b/src/webenginewidgets/doc/snippets/push-notifications/commands new file mode 100644 index 000000000..aee9761c1 --- /dev/null +++ b/src/webenginewidgets/doc/snippets/push-notifications/commands @@ -0,0 +1,19 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +//! [0] +npm init -y +npm install web-push express +//! [0] + +//! [1] +"start": "node server.js" +//! [1] + +//! [2] +./node_odules/.bin/web-push generate-vapid-keys +//! [2] + +//! [3] +npm start +//! [3] diff --git a/src/webenginewidgets/doc/snippets/qtwebengine_qwebengineview_snippet.cpp b/src/webenginewidgets/doc/snippets/qtwebengine_qwebengineview_snippet.cpp index c12490ec1..64531cf3a 100644 --- a/src/webenginewidgets/doc/snippets/qtwebengine_qwebengineview_snippet.cpp +++ b/src/webenginewidgets/doc/snippets/qtwebengine_qwebengineview_snippet.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause void wrapInFunction() { diff --git a/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc b/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc index e732bbeed..f11f550ff 100644 --- a/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc +++ b/src/webenginewidgets/doc/snippets/qtwebenginewidgets_build_snippet.qdoc @@ -5,12 +5,7 @@ QT += webenginewidgets //! [0] - -//! [1] -#include <QtWebEngineWidgets> -//! [1] - //! [2] find_package(Qt6 REQUIRED COMPONENTS WebEngineWidgets) -target_link_libraries(target PRIVATE Qt::WebEngineWidgets) +target_link_libraries(target PRIVATE Qt6::WebEngineWidgets) //! [2] diff --git a/src/webenginewidgets/doc/snippets/simple/main.cpp b/src/webenginewidgets/doc/snippets/simple/main.cpp index f887aabaa..08613906b 100644 --- a/src/webenginewidgets/doc/snippets/simple/main.cpp +++ b/src/webenginewidgets/doc/snippets/simple/main.cpp @@ -1,18 +1,19 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +//! [Minimal Example] #include <QApplication> -#include <QUrl> #include <QWebEngineView> int main(int argc, char *argv[]) { QApplication app(argc, argv); - QWidget *parent = nullptr; //! [Using QWebEngineView] - QWebEngineView *view = new QWebEngineView(parent); - view->load(QUrl("http://qt-project.org/")); - view->show(); + QWebEngineView view; + view.load(QUrl("https://qt-project.org/")); + view.resize(1024, 750); + view.show(); //! [Using QWebEngineView] return app.exec(); } +//! [Minimal Example] diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc index 15f6d08f4..c9bd76bf4 100644 --- a/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc +++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc @@ -5,7 +5,6 @@ \group webengine-widgetexamples \title Qt WebEngine Widgets Examples \brief Examples demonstrating the \QWE Widgets usage. - \ingroup all-examples Qt provides an integrated Web browser component based on Chromium, the popular open source browser engine. diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc index a80400c60..8eb28b797 100644 --- a/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc +++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc @@ -10,11 +10,6 @@ \section1 Getting Started - To include the definitions of the module's classes, use the - following directive: - - \snippet qtwebenginewidgets_build_snippet.qdoc 1 - To link against the module, add this line to your qmake project file: \snippet qtwebenginewidgets_build_snippet.qdoc 0 diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc index b88d7af36..ef5a1c4b5 100644 --- a/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc +++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc @@ -13,11 +13,6 @@ The \QWE Widgets module provides a web browser engine as well as C++ classes to render and interact with web content. - To include the definitions of the module's classes, use the - following directive: - - \snippet qtwebenginewidgets_build_snippet.qdoc 1 - \if !defined(qtforpython) To link against the module using build with qmake, add the following QT variable to your qmake .pro file: @@ -29,4 +24,9 @@ \snippet qtwebenginewidgets_build_snippet.qdoc 2 \endif + + The minimum amount of code needed to load and display an HTML page requires just + implementing the \c QWebEngineView class. + + \snippet simple/main.cpp Minimal Example */ diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc index 34aa53278..3153ec952 100644 --- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc @@ -1,24 +1,8 @@ -/* - Copyright (C) 2019 The Qt Company Ltd. - Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) - Copyright (C) 2008 Holger Hans Peter Freyther - Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ +// Copyright (C) 2019 The Qt Company Ltd. +// Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) +// Copyright (C) 2008 Holger Hans Peter Freyther +// Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in> +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // The documentation in this file was imported from QtWebKit and is thus constrained // by its LGPL license. Documentation written from scratch for new methods should be @@ -77,7 +61,7 @@ new windows, such as pop-up windows, you can subclass QWebEngineView and reimplement the createWindow() function. - \sa {WebEngine Widgets Simple Browser Example}, {WebEngine Content Manipulation Example}, {WebEngine Markdown Editor Example} + \sa {WebEngine Widgets Simple Browser Example}, {WebEngine Content Manipulation Example} */ @@ -124,9 +108,8 @@ \fn void QWebEngineView::setHtml(const QString &html, const QUrl &baseUrl) Sets the content of the web view to the specified \a html content. - External objects, such as stylesheets or images referenced in the HTML - document, are located relative to \a baseUrl. For external objects to - be loaded, \c baseUrl cannot be empty. For example, if \a html + \a baseUrl is optional and used to resolve relative URLs in the document, + such as referenced images or stylesheets. For example, if \a html is retrieved from \c http://www.example.com/documents/overview.html, which is the base URL, then an image referenced with the relative URL, \c diagram.png, should be at \c{http://www.example.com/documents/diagram.png}. @@ -160,7 +143,7 @@ is empty, it is assumed that the content is \c{text/plain,charset=US-ASCII}. External objects referenced in the content are located relative to \a baseUrl. - For external objects to be loaded, \c baseUrl cannot be empty. + For external objects with relative URLs to be loaded, \c baseUrl cannot be empty. The data is loaded immediately; external objects are loaded asynchronously. @@ -226,6 +209,7 @@ /*! \fn QAction *QWebEngineView::pageAction(QWebEnginePage::WebAction action) const Returns a pointer to a QAction that encapsulates the specified web action \a action. + This function will also set a default styled icon to the QAction if it lacks one. */ /*! |