diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-21 19:13:32 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-21 19:13:32 +0200 |
| commit | 55fd16d92a36558335e7d7cd7cdb57ead43d55db (patch) | |
| tree | 2573c4fabdb80535972a3c91a262f2e3fa80cf80 /sources/pyside2/doc/tutorials | |
| parent | e8d90a9e62898d3b746772d9ae8542b87efcecf8 (diff) | |
| parent | 85bb24c39df53ea61f59351a60f4284c32cb50ff (diff) | |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I8831b840fa7816b8919ecbaab17b41822a0a6012
Diffstat (limited to 'sources/pyside2/doc/tutorials')
| -rw-r--r-- | sources/pyside2/doc/tutorials/basictutorial/uifiles.rst | 17 | ||||
| -rw-r--r-- | sources/pyside2/doc/tutorials/index.rst | 6 |
2 files changed, 12 insertions, 11 deletions
diff --git a/sources/pyside2/doc/tutorials/basictutorial/uifiles.rst b/sources/pyside2/doc/tutorials/basictutorial/uifiles.rst index 804905eb8..982384629 100644 --- a/sources/pyside2/doc/tutorials/basictutorial/uifiles.rst +++ b/sources/pyside2/doc/tutorials/basictutorial/uifiles.rst @@ -1,5 +1,5 @@ -Using `.ui` Files (`QUiLoader` and `pyside2-uic`) -************************************************* +Using `.ui` files from Designer or QtCreator with `QUiLoader` and `pyside2-uic` +******************************************************************************* This page describes the use of Qt Creator to create graphical interfaces for your Qt for Python project. @@ -13,8 +13,9 @@ 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. -Your file (mainwindow.ui) should look something like this: -:: +Your file ``mainwindow.ui`` should look something like this: + +.. code-block:: xml <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> @@ -73,8 +74,8 @@ Your file (mainwindow.ui) should look something like this: Now we are ready to decide how to use the **UI file** from Python. -Generating a Python class -========================= +Option A: Generating a Python class +=================================== Another option to interact with a **UI file** is to generate a Python class from it. This is possible thanks to the `pyside2-uic` tool. @@ -128,8 +129,8 @@ file: You must run `pyside2-uic` again every time you make changes to the **UI file**. -Loading it directly -==================== +Option B: Loading it directly +============================= To load the UI file directly, we will need a class from the **QtUiTools** module: diff --git a/sources/pyside2/doc/tutorials/index.rst b/sources/pyside2/doc/tutorials/index.rst index 9739eee97..a159725a7 100644 --- a/sources/pyside2/doc/tutorials/index.rst +++ b/sources/pyside2/doc/tutorials/index.rst @@ -11,7 +11,7 @@ Basic tutorials --------------- .. toctree:: - :maxdepth: 2 + :maxdepth: 1 basictutorial/widgets.rst basictutorial/qml.rst @@ -25,7 +25,7 @@ Real use-cases applications --------------------------- .. toctree:: - :maxdepth: 2 + :maxdepth: 1 datavisualize/index.rst expenses/expenses.rst @@ -37,6 +37,6 @@ C++ and Python -------------- .. toctree:: - :maxdepth: 2 + :maxdepth: 1 portingguide/index.rst |
