diff options
| author | Alexei Cazacov <alexei.cazacov@qt.io> | 2025-08-01 13:48:48 +0300 |
|---|---|---|
| committer | Alexei Cazacov <alexei.cazacov@qt.io> | 2025-12-09 08:40:42 +0000 |
| commit | 11f9fe51ab0536ca33368fbf4ebb01194da6a4d2 (patch) | |
| tree | dc4a9f4464b6aa88f55d1c1a0523dd39c7ee5e59 /examples/quick/quickwidgets/quickwidget | |
| parent | 646385b5a90a21e234b36c6727165794d0ac83fa (diff) | |
Doc: Overhaul the descriptions of examples about hybrid UI
The examples that demonstrate hybrid UI approaches lack proper
descriptions. This commit restructures and enhances the descriptions
for these.
Task-number: QTBUG-134102
Pick-to: 6.11 6.10
Change-Id: I5cf604fee932024cbe73347696e19f9c6e22d5b7
Reviewed-by: Alexei Cazacov <alexei.cazacov@qt.io>
Diffstat (limited to 'examples/quick/quickwidgets/quickwidget')
| -rw-r--r-- | examples/quick/quickwidgets/quickwidget/doc/images/qquickwidget_grab_screenshot.webp | bin | 0 -> 15902 bytes | |||
| -rw-r--r-- | examples/quick/quickwidgets/quickwidget/doc/images/qquickwidget_mdi_example.webp | bin | 0 -> 19750 bytes | |||
| -rw-r--r-- | examples/quick/quickwidgets/quickwidget/doc/images/qtquickwidgets-example.png | bin | 11287 -> 0 bytes | |||
| -rw-r--r-- | examples/quick/quickwidgets/quickwidget/doc/images/qtquickwidgets-example.webp | bin | 0 -> 10976 bytes | |||
| -rw-r--r-- | examples/quick/quickwidgets/quickwidget/doc/src/quickwidget.qdoc | 53 |
5 files changed, 49 insertions, 4 deletions
diff --git a/examples/quick/quickwidgets/quickwidget/doc/images/qquickwidget_grab_screenshot.webp b/examples/quick/quickwidgets/quickwidget/doc/images/qquickwidget_grab_screenshot.webp Binary files differnew file mode 100644 index 0000000000..b720b5c651 --- /dev/null +++ b/examples/quick/quickwidgets/quickwidget/doc/images/qquickwidget_grab_screenshot.webp diff --git a/examples/quick/quickwidgets/quickwidget/doc/images/qquickwidget_mdi_example.webp b/examples/quick/quickwidgets/quickwidget/doc/images/qquickwidget_mdi_example.webp Binary files differnew file mode 100644 index 0000000000..75c4e46e39 --- /dev/null +++ b/examples/quick/quickwidgets/quickwidget/doc/images/qquickwidget_mdi_example.webp diff --git a/examples/quick/quickwidgets/quickwidget/doc/images/qtquickwidgets-example.png b/examples/quick/quickwidgets/quickwidget/doc/images/qtquickwidgets-example.png Binary files differdeleted file mode 100644 index d9e710b7e7..0000000000 --- a/examples/quick/quickwidgets/quickwidget/doc/images/qtquickwidgets-example.png +++ /dev/null diff --git a/examples/quick/quickwidgets/quickwidget/doc/images/qtquickwidgets-example.webp b/examples/quick/quickwidgets/quickwidget/doc/images/qtquickwidgets-example.webp Binary files differnew file mode 100644 index 0000000000..b881f05f33 --- /dev/null +++ b/examples/quick/quickwidgets/quickwidget/doc/images/qtquickwidgets-example.webp diff --git a/examples/quick/quickwidgets/quickwidget/doc/src/quickwidget.qdoc b/examples/quick/quickwidgets/quickwidget/doc/src/quickwidget.qdoc index 0a80b32c4a..1ea20e11f1 100644 --- a/examples/quick/quickwidgets/quickwidget/doc/src/quickwidget.qdoc +++ b/examples/quick/quickwidgets/quickwidget/doc/src/quickwidget.qdoc @@ -1,12 +1,57 @@ -// Copyright (C) 2017 The Qt Company Ltd. +// Copyright (C) 2025 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \title Qt Quick Widgets Example \example quickwidgets/quickwidget - \brief Demonstrates how to mix QML with a Qt Widgets application using the QQuickWidget class. + \brief Demonstrates how to mix Qt Quick with a Qt Widgets application using the QQuickWidget class. \examplecategory {User Interface Components} - \image qtquickwidgets-example.png -*/ + \image qtquickwidgets-example.webp {Digital clock and rotating rectangle in MDI subwindows} + + The example demonstrates how you can embed Qt Quick scenes inside a Qt + Widgets application, and how different UI aspects integrate between Qt + Widgets and Qt Quick. This includes: + + \list + \li Tab focusing between Qt Widgets and Qt Quick + \li Embedding a QQuickView inside a QLayout + \endlist + + \include examples-run.qdocinc + + \section1 Qt Quick view integration + + To demonstrate seamless integration of Qt Quick view, the example + implements several approaches of taking a screenshot of the Qt Quick view. + + In the main menu, select \uicontrol {File}, then select any of these + options to grab a screenshot of the Qt Quick view: + \list + \li \uicontrol {Grab framebuffer} - grabs the screenshot using the + \l QQuickWidget::grabFramebuffer function. + \li \uicontrol {Render to pixmap} - grabs the screenshot using the + \l QWidget::render function and a \l QPixmap instance as a + parameter. This approach is common for Qt Widgets. + \li \uicontrol {Grab via grabToImage} - calls the + \c performLayerBasedGrab function declared in the QML file. + The \c performLayerBasedGrab function calls + QML Item's \l Item::grabToImage function to grab the screenshot. + This approach demonstrates how to call nested view's QML APIs from + C++. + \endlist + + \image qquickwidget_grab_screenshot.webp {File menu with three screenshot capture options} + + \section1 QQuickWidget in MDI + + The example also demonstrates how you can use QQuickWidget to seamlessly + integrate hardware accelerated Qt Quick scenes in a Qt Widget Multiple + Document Interface (MDI) application. + + To open a new MDI subwindow, in the main menu, select + \uicontrol {Window} > \uicontrol {Add tab widget}. + + \image qquickwidget_mdi_example.webp {MDI window with multiple tabbed subwindows} +*/ |
