Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve QML widget description and usage #9492

Merged
merged 2 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 22 additions & 2 deletions docs/user_manual/working_with_vector/vector_properties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2340,7 +2340,8 @@ Other Widgets
The drag and drop designer offers a number of widgets that are not connected to a particular field.
They can be used to enhance the appearance of the form or to display dynamically calculated values.

* :guilabel:`HTML Widget`: embeds an HTML page, the HTML source may contain the result of dynamically calculated expressions.
* :guilabel:`HTML Widget`: embeds an HTML page, the HTML source may contain the result
of dynamically calculated expressions.

HTML widgets can be used for example to display images stored as BLOB in a field
(let's call it ``photo``):
Expand All @@ -2367,11 +2368,30 @@ They can be used to enhance the appearance of the form or to display dynamically

A preview of your image is displayed on the right.

* :guilabel:`QML Widget`: embeds a QML page, the QML source may contain the result of dynamically calculated expressions.
* :guilabel:`QML Widget`: embeds a Qt QML_ document, displaying graphical elements in the attribute form.
Beside the custom :guilabel:`Title` of the added widget and whether it should be shown or not,
you can select from predefined :guilabel:`QML code` elements:

* :guilabel:`Free text...`: allows you to write from scratch or paste an existing code
* :guilabel:`Rectangle`: provides a minimal code for displaying a rectangle
* :guilabel:`Bar chart`: provides a minimal code for displaying a bar chart
* :guilabel:`Pie chart`: provides a minimal code for displaying a pie chart

You can extend the code with QML syntax, use layer fields or QGIS expressions
that are dynamically calculated.

.. _figure_qml_widget:

.. figure:: img/qml_widget_dialog.png
:align: center

Setting a QML graph to display in attribute form

* :guilabel:`Text Widget`: displays a text widget which supports basic HTML markup
and may contain the result of dynamically calculated expressions.
* :guilabel:`Spacer Widget`: inserts an empty transparent rectangle, increasing the vertical distance between two widgets.

.. _QML: https://doc.qt.io/qt-5/qtqml-syntax-basics.html

.. tip:: **Display Dynamic Content**

Expand Down
Loading