diff options
Diffstat (limited to 'sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst')
-rw-r--r-- | sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst b/sources/pyside6/doc/tutorials/portingguide/chapter3/chapter3.rst index b2e06b144..98d4d3982 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 @@ -21,9 +21,9 @@ and add the following imports to it: To generate this Python code, run the following command on the prompt: -.. code-block:: +.. code-block:: bash - pyside6-uic bookwindow.ui > ui_bookwindow.py + pyside6-uic bookwindow.ui -o ui_bookwindow.py Try porting the remaining code now. To begin with, here is how both the versions of the constructor code looks: @@ -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: @@ -101,9 +101,9 @@ image only. Now, run the ``pyside6-rcc`` tool on the ``books.qrc`` file to generate ``rc_books.py``. -.. code-block:: +.. code-block:: bash - pyside6-rcc books.qrc > rc_books.py + pyside6-rcc books.qrc -o rc_books.py Once you have the Python script generated, make the following changes to ``bookdelegate.py`` and ``main.py``: |