aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/doc/tutorials/basictutorial/dialog.rst
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2020-12-27 21:45:13 +0100
committerCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2021-02-04 12:56:16 +0100
commita6c7e9d7fd65946762766e40793ba86291bcca1a (patch)
treef99eb63a95680f0ad364d838c1088e7875bc9dfc /sources/pyside6/doc/tutorials/basictutorial/dialog.rst
parent961cc3afb3b4c680f98dd52bb3d5a2d03cb424c1 (diff)
doc: general update and add more information
Updates: * Refreshing the information on installing and building PySide * Adding hyperlinks to some files * Including PySide installation GIF (from Wiki) * Modifying the CSS to improve the code snippets, :command: role, and adding layout for two columns. New tutorials * QTableWidget * QTreeWidget New documentation * Differences between Widgets and QML * IDE information (+ QtCreator GIF from Wiki) * When to use Shiboken * file types explanation * Summary on distributing applications Pick-to: 6.0 Change-Id: I5195cc5a4af858bb7aad7891d14562ca07b6df23 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/doc/tutorials/basictutorial/dialog.rst')
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/dialog.rst20
1 files changed, 8 insertions, 12 deletions
diff --git a/sources/pyside6/doc/tutorials/basictutorial/dialog.rst b/sources/pyside6/doc/tutorials/basictutorial/dialog.rst
index 04f6ffa5d..da3b336cd 100644
--- a/sources/pyside6/doc/tutorials/basictutorial/dialog.rst
+++ b/sources/pyside6/doc/tutorials/basictutorial/dialog.rst
@@ -1,5 +1,5 @@
-Creating a Simple PySide6 Dialog Application
-*********************************************
+Creating a Dialog Application
+=============================
This tutorial shows how to build a simple dialog with some
basic widgets. The idea is to let users provide their name
@@ -43,7 +43,7 @@ just sets the title of the dialog window. In `main()`, you can see
that we are creating a *Form object* and showing it to the world.
Create the Widgets
-===================
+------------------
We are going to create two widgets: a `QLineEdit` where users can
enter their name, and a `QPushButton` that prints the contents of
@@ -59,7 +59,7 @@ It's obvious from the code that both widgets will show the corresponding
texts.
Create a layout to organize the Widgets
-========================================
+---------------------------------------
Qt comes with layout-support that helps you organize the widgets
in your application. In this case, let's use `QVBoxLayout` to lay out
@@ -68,18 +68,14 @@ after creating the widgets:
::
# Create layout and add widgets
- layout = QVBoxLayout()
+ layout = QVBoxLayout(self)
layout.addWidget(self.edit)
layout.addWidget(self.button)
- # Set dialog layout
- self.setLayout(layout)
-So, we create the layout, add the widgets with `addWidget()`,
-and finally we say that our **Form** will have our `QVBoxLayout`
-as its layout.
+So, we create the layout, add the widgets with `addWidget()`.
Create the function to greet and connect the Button
-====================================================
+---------------------------------------------------
Finally, we just have to add a function to our custom **Form**
and *connect* our button to it. Our function will be a part of
@@ -106,7 +102,7 @@ Once executed, you can enter your name in the `QLineEdit` and watch
the console for greetings.
Complete code
-=============
+-------------
Here is the complete code for this tutorial:
::