aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-06-25 11:29:10 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-06-28 17:16:52 +0200
commit020ada12c366e579b92803fd8a82010b8d93d87d (patch)
treeb8c7ac2b977de5cf0bce4923edd1c71d859abe0a
parentfc916c509263ac13083a8e00a8afc9d930ed0dd1 (diff)
PySide6: Update documentation on Qt Designer and resource files
Link from typesoffiles.rst to the tutorials and flesh them out a bit. Task-number: PYSIDE-1112 Pick-to: 6.1 Change-Id: I67fccb29d880bd2ba5af8e5dd77a4f6406ea55ad Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/qrcfiles.rst4
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/uifiles.rst29
-rw-r--r--sources/pyside6/doc/tutorials/pretutorial/typesoffiles.rst9
3 files changed, 27 insertions, 15 deletions
diff --git a/sources/pyside6/doc/tutorials/basictutorial/qrcfiles.rst b/sources/pyside6/doc/tutorials/basictutorial/qrcfiles.rst
index 001066ba6..477c5b738 100644
--- a/sources/pyside6/doc/tutorials/basictutorial/qrcfiles.rst
+++ b/sources/pyside6/doc/tutorials/basictutorial/qrcfiles.rst
@@ -6,6 +6,10 @@ Using `.qrc` Files (`pyside6-rcc`)
The `Qt Resource System`_ is a mechanism for storing binary files
in an application.
+The files will be embedded into the application and be acessible for the
+``QFile`` class and the constructors of the ``QIcon`` and ``QPixmap``
+classes taking a file name by using a special file name starting with ``:/``.
+
The most common uses are for custom images, icons, fonts, among others.
In this tutorial you will learn how to load custom images as button icons.
diff --git a/sources/pyside6/doc/tutorials/basictutorial/uifiles.rst b/sources/pyside6/doc/tutorials/basictutorial/uifiles.rst
index 32ebf7b20..adf5ec6d2 100644
--- a/sources/pyside6/doc/tutorials/basictutorial/uifiles.rst
+++ b/sources/pyside6/doc/tutorials/basictutorial/uifiles.rst
@@ -3,17 +3,22 @@
Using `.ui` files from Designer or QtCreator with `QUiLoader` and `pyside6-uic`
*******************************************************************************
-This page describes the use of Qt Creator to create graphical
-interfaces for your Qt for Python project.
-You will need **Qt Creator** to design and modify your interface (UI file).
-
-If you don't know how to use Qt Creator, refer to the
-`Using Qt Designer <http://doc.qt.io/qtcreator/creator-using-qt-designer.html>`_
-documentation page.
-
-At Qt Creator, create a new Qt Design Form, choose "Main Window" for template.
-And save as `mainwindow.ui`.
-Add a `QPushButton` to the center of the centralwidget.
+This page describes the use of
+`Qt Designer <https://doc.qt.io/qt-6/qtdesigner-manual.html>`_ to create
+graphical interfaces based on Qt Widgets for your Qt for Python project.
+**Qt Designer** is a graphical UI design tool which is available as a
+standalone binary (``pyside6-designer``) or embedded into the
+`Qt Creator IDE <https://doc.qt.io/qtcreator>`_. Its use within **Qt Creator**
+is described at
+`Using Qt Designer <http://doc.qt.io/qtcreator/creator-using-qt-designer.html>`_.
+
+The designs are stored in `.ui` files, which is an XML-based format. It will
+be converted to Python or C++ code populating a widget instance at project build
+time by the `pyside6-uic <https://doc.qt.io/qt-6/uic.html>`_ tool.
+
+To create a new Qt Design Form in **Qt Creator**, choose
+`File/New File Or Project` and "Main Window" for template. Save it as
+`mainwindow.ui`. Add a `QPushButton` to the center of the centralwidget.
Your file ``mainwindow.ui`` should look something like this:
@@ -79,7 +84,7 @@ Now we are ready to decide how to use the **UI file** from Python.
Option A: Generating a Python class
===================================
-Another option to interact with a **UI file** is to generate a Python
+The standard way to interact with a **UI file** is to generate a Python
class from it. This is possible thanks to the `pyside6-uic` tool.
To use this tool, you need to run the following command on a console::
diff --git a/sources/pyside6/doc/tutorials/pretutorial/typesoffiles.rst b/sources/pyside6/doc/tutorials/pretutorial/typesoffiles.rst
index f606c2784..71d38f809 100644
--- a/sources/pyside6/doc/tutorials/pretutorial/typesoffiles.rst
+++ b/sources/pyside6/doc/tutorials/pretutorial/typesoffiles.rst
@@ -36,9 +36,9 @@ functionality to your applications.
User Interface Definition File ``.ui``
--------------------------------------
-When using Qt Designer, you can create interfaces with the WYSIWYG
-form editor, this interface is represented as a widget tree using XML.
-Here is an extract of the beginning of a ``.ui`` file:
+When using Qt Designer, you can create user interfaces using Qt Widgets with
+the WYSIWYG form editor, this interface is represented as a widget tree using
+XML. Here is an extract of the beginning of a ``.ui`` file:
.. code-block:: xml
@@ -64,6 +64,8 @@ The `pyside6-uic` tool generates Python code from these `.ui` files,
which you can import from your main files, so it is not necessary
for you to include the `.ui` files in your deployed application.
+For more details, see :ref:`using_ui_files`.
+
Resource Collection Files ``.qrc``
----------------------------------
@@ -84,6 +86,7 @@ The `pyside6-rcc` tool generates Python code from these `.qrc` files,
so you are not required to include the listed files in your deployed
application.
+For more details, see :ref:`using_qrc_files`.
Qt Modeling Language File ``.qml``
----------------------------------