aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/doc/tutorials/portingguide
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2022-06-22 20:42:42 +0200
committerCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2022-06-22 22:21:15 +0200
commit99d76b5e4e2397fcb4ddf45de91748ab1861f755 (patch)
treee0c27f7a68f30ae7c138d3f527123bb66d6cf14f /sources/pyside6/doc/tutorials/portingguide
parentafb43a34d2360116f8e00506c58fa11ffd124179 (diff)
docs: adapt snippets to new license rows
The license headers are now a couple of lines compared to the previous 40 lines, so the snippets that select 'from which line' the code must be included needed some adaptation. Change-Id: Id8bb87d708cc7c9edadb1b8265cecf81bf0bf5ae Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/doc/tutorials/portingguide')
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter1/chapter1.rst12
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter2/chapter2.rst12
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst12
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/index.rst2
4 files changed, 19 insertions, 19 deletions
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter1/chapter1.rst b/sources/pyside6/doc/tutorials/portingguide/chapter1/chapter1.rst
index 20b11065a..97fcd2200 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter1/chapter1.rst
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter1/chapter1.rst
@@ -17,7 +17,7 @@ the beginning of ``createdb.py``:
.. literalinclude:: createdb.py
:language: python
:linenos:
- :lines: 40-44
+ :lines: 3-7
The ``initDb`` function does most of the work needed to
set up the database, but it depends on the ``addAuthor``,
@@ -31,7 +31,7 @@ C++ version
.. literalinclude:: initdb.h
:language: c++
:linenos:
- :lines: 55-81
+ :lines: 18-44
Python version
---------------
@@ -39,7 +39,7 @@ Python version
.. literalinclude:: createdb.py
:language: python
:linenos:
- :lines: 44-65
+ :lines: 7-28
Now that the helper functions are in place, port ``initDb``.
Here is how the C++ and Python versions of this function
@@ -51,7 +51,7 @@ C++ version
.. literalinclude:: initdb.h
:language: c++
:linenos:
- :lines: 81-159
+ :lines: 44-122
Python version
---------------
@@ -59,7 +59,7 @@ Python version
.. literalinclude:: createdb.py
:language: python
:linenos:
- :lines: 65-
+ :lines: 28-
.. note:: The Python version uses the ``check`` function to
execute the SQL statements instead of the ``if...else``
@@ -73,7 +73,7 @@ test it, add the following code to ``main.py`` and run it:
.. literalinclude:: main.py
:language: python
:linenos:
- :lines: 40-
+ :lines: 3-
Use the following command from the prompt to run:
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter2/chapter2.rst b/sources/pyside6/doc/tutorials/portingguide/chapter2/chapter2.rst
index a574218fd..fa6ef1116 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter2/chapter2.rst
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/chapter2.rst
@@ -12,7 +12,7 @@ editor for foreign key fields. To begin with, create
.. literalinclude:: bookdelegate.py
:language: python
:linenos:
- :lines: 40-47
+ :lines: 3-10
After the necessary ``import`` statements, port the
constructor code for the ``BookDelegate`` class. Both
@@ -26,7 +26,7 @@ C++ version
.. literalinclude:: bookdelegate.cpp
:language: c++
:linenos:
- :lines: 54-59
+ :lines: 17-22
Python version
---------------
@@ -34,7 +34,7 @@ Python version
.. literalinclude:: bookdelegate.py
:language: python
:linenos:
- :lines: 47-54
+ :lines: 10-17
.. note:: The Python version loads the ``QPixmap`` using
the absolute path of ``star.png`` in the local
@@ -53,7 +53,7 @@ C++ version
.. literalinclude:: bookdelegate.cpp
:language: c++
:linenos:
- :lines: 59-
+ :lines: 22-
Python version
---------------
@@ -61,7 +61,7 @@ Python version
.. literalinclude:: bookdelegate.py
:language: python
:linenos:
- :lines: 55-
+ :lines: 18-
Now that the delegate is in place, run the following
``main.py`` to see how the data is presented:
@@ -69,7 +69,7 @@ Now that the delegate is in place, run the following
.. literalinclude:: main.py
:language: python
:linenos:
- :lines: 40-
+ :lines: 3-
Here is how the application will look when you run it:
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst b/sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst
index b2e06b144..1d48d4ea3 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst
@@ -11,7 +11,7 @@ and add the following imports to it:
.. literalinclude:: bookwindow.py
:language: python
:linenos:
- :lines: 40-53
+ :lines: 3-16
.. note:: The imports include the ``BookDelegate`` you
ported earlier and the ``Ui_BookWindow``. The pyside-uic
@@ -34,7 +34,7 @@ C++ version
.. literalinclude:: bookwindow.cpp
:language: c++
:linenos:
- :lines: 57-140
+ :lines: 20-103
Python version
---------------
@@ -42,7 +42,7 @@ Python version
.. literalinclude:: bookwindow.py
:language: python
:linenos:
- :lines: 53-116
+ :lines: 16-79
.. note:: The Python version of the ``BookWindow`` class
definition inherits from both ``QMainWindow`` and
@@ -57,7 +57,7 @@ C++ version
.. literalinclude:: bookwindow.cpp
:language: c++
:linenos:
- :lines: 115-
+ :lines: 78-
Python version
---------------
@@ -65,7 +65,7 @@ Python version
.. literalinclude:: bookwindow.py
:language: python
:linenos:
- :lines: 117-
+ :lines: 80-
Now that all the necessary pieces are in place, try to put
them together in ``main.py``.
@@ -73,7 +73,7 @@ them together in ``main.py``.
.. literalinclude:: main.py
:language: python
:linenos:
- :lines: 40-
+ :lines: 3-
Try running this to see if you get the following output:
diff --git a/sources/pyside6/doc/tutorials/portingguide/index.rst b/sources/pyside6/doc/tutorials/portingguide/index.rst
index bc7e6dee5..ed1a7a4f6 100644
--- a/sources/pyside6/doc/tutorials/portingguide/index.rst
+++ b/sources/pyside6/doc/tutorials/portingguide/index.rst
@@ -153,7 +153,7 @@ demonstrating some of these differences:
.. literalinclude:: hello_world_ex.py
:linenos:
- :lines: 40-
+ :lines: 3-
.. note:: The ``if`` block is just a good practice when
developing a Python application. It lets the Python file