From a004d5a301402f4500612863b8220622ee5d87ac Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 12 Sep 2022 10:37:08 +0200 Subject: Update documentation - Use version 6.2 - Delete obsolete paragraphs - Fix some errors Change-Id: I0c86f013fb3ad21a4cc7c5d490a9f129e80f3540 Reviewed-by: Cristian Maureira-Fredes (cherry picked from commit 276d60b71a72a548340e6684a21fd122c4365ed9) Reviewed-by: Qt Cherry-pick Bot --- sources/pyside6/doc/gettingstarted-linux.rst | 8 ++++---- sources/pyside6/doc/gettingstarted-macOS.rst | 12 ++++++------ sources/pyside6/doc/gettingstarted-windows.rst | 12 ++++++------ sources/pyside6/doc/gettingstarted.rst | 12 +++--------- sources/pyside6/doc/porting_from2.rst | 18 ++++++------------ .../doc/tutorials/basictutorial/signals_and_slots.rst | 2 +- 6 files changed, 26 insertions(+), 38 deletions(-) diff --git a/sources/pyside6/doc/gettingstarted-linux.rst b/sources/pyside6/doc/gettingstarted-linux.rst index 900da999e..d32412fdf 100644 --- a/sources/pyside6/doc/gettingstarted-linux.rst +++ b/sources/pyside6/doc/gettingstarted-linux.rst @@ -46,14 +46,14 @@ Cloning the official repository can be done by:: Checking out the version that we want to build, for example 6.0:: - cd pyside-setup && git checkout 6.0 + cd pyside-setup && git checkout 6.2 Install the general dependencies:: pip install -r requirements.txt .. note:: Keep in mind you need to use the same version as your Qt installation. - Additionally, :command:`git checkout -b 6.0 --track origin/6.0` could be a better option + Additionally, :command:`git checkout -b 6.2 --track origin/6.2` could be a better option in case you want to work on it. Building and Installing (setuptools) @@ -67,11 +67,11 @@ for example, :command:`/opt/Qt/6.0.0/gcc_64/bin/qtpaths`. Build can take a few minutes, so it is recommended to use more than one CPU core:: - python setup.py build --qtpaths=/opt/Qt/6.0.0/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8 + python setup.py build --qtpaths=/opt/Qt/6.2.1/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8 To install on the current directory, just run:: - python setup.py install --qtpaths=/opt/Qt/6.0.0/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8 + python setup.py install --qtpaths=/opt/Qt/6.2.1/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8 Building and Installing (cmake) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/sources/pyside6/doc/gettingstarted-macOS.rst b/sources/pyside6/doc/gettingstarted-macOS.rst index 21e9af393..546902717 100644 --- a/sources/pyside6/doc/gettingstarted-macOS.rst +++ b/sources/pyside6/doc/gettingstarted-macOS.rst @@ -45,11 +45,11 @@ Getting PySide Cloning the official repository can be done by:: - git clone --recursive https://code.qt.io/pyside/pyside-setup + git clone https://code.qt.io/pyside/pyside-setup -Checking out the version that we want to build, for example, 6.0:: +Checking out the version that we want to build, for example, 6.2:: - cd pyside-setup && git checkout 6.0 + cd pyside-setup && git checkout 6.2 Install the general dependencies:: @@ -61,18 +61,18 @@ Building PySide ~~~~~~~~~~~~~~~ Check your Qt installation path, to specifically use that version of qtpaths to build PySide. -for example, ``/opt/Qt/6.0.0/gcc_64/bin/qtpaths``. +for example, ``/opt/Qt/6.2.1/gcc_64/bin/qtpaths``. Build can take a few minutes, so it is recommended to use more than one CPU core:: - python setup.py build --qtpaths=/opt/Qt/6.0.0/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8 + python setup.py build --qtpaths=/opt/Qt/6.2.1/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8 Installing PySide ~~~~~~~~~~~~~~~~~ To install on the current directory, just run:: - python setup.py install --qtpaths=/opt/Qt/6.0.0/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8 + python setup.py install --qtpaths=/opt/Qt/6.2.1/gcc_64/bin/qtpaths --build-tests --ignore-git --parallel=8 Test installation ~~~~~~~~~~~~~~~~~ diff --git a/sources/pyside6/doc/gettingstarted-windows.rst b/sources/pyside6/doc/gettingstarted-windows.rst index 369cb95eb..0e1f5cdfe 100644 --- a/sources/pyside6/doc/gettingstarted-windows.rst +++ b/sources/pyside6/doc/gettingstarted-windows.rst @@ -7,14 +7,14 @@ selected when using the online installer. Requirements ------------ - * `MSVC2017`_ (or MSVC2019) for Python 3 on Windows, + * `MSVC2022`_ or (MSVC2019) for Python 3 on Windows, * `OpenSSL`_ (optional for SSL support, Qt must have been configured using the same SSL library). * ``sphinx`` package for the documentation (optional). .. note:: Python 3.8.0 was missing some API required for PySide/Shiboken so it's not possible to use it for a Windows build. -.. _MSVC2017: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools +.. _MSVC2022: https://visualstudio.microsoft.com/downloads/ .. _OpenSSL: https://sourceforge.net/projects/openssl/ Building from source on Windows 10 @@ -53,11 +53,11 @@ Getting PySide Cloning the official repository can be done by:: - git clone --recursive https://code.qt.io/pyside/pyside-setup + git clone https://code.qt.io/pyside/pyside-setup -Checking out the version that we want to build, for example, 6.0:: +Checking out the version that we want to build, for example, 6.2:: - cd pyside-setup && git checkout 6.0 + cd pyside-setup && git checkout 6.2 Install the general dependencies:: @@ -69,7 +69,7 @@ Building PySide ~~~~~~~~~~~~~~~ Check your Qt installation path, to specifically use that version of qtpaths to build PySide. -for example, ``E:\Qt\6.0.0\msvc2019_64\bin\qtpaths.exe``. +for example, ``C:\Qt\6.2.1\msvc2019_64\bin\qtpaths.exe``. Build can take a few minutes, so it is recommended to use more than one CPU core:: diff --git a/sources/pyside6/doc/gettingstarted.rst b/sources/pyside6/doc/gettingstarted.rst index 2ff8e30c2..47829171b 100644 --- a/sources/pyside6/doc/gettingstarted.rst +++ b/sources/pyside6/doc/gettingstarted.rst @@ -94,7 +94,7 @@ Using the ``--build-tests`` option will enable us to run all the auto tests insi python testrunner.py test > testlog.txt .. note:: On Windows, don't forget to have qtpaths in your path - (:command:`set PATH=E:\\\Path\\\to\\\Qt\\\6.0.0\\\msvc2019_64\\\bin;%PATH%`) + (:command:`set PATH=C:\\\Path\\\to\\\Qt\\\6.2.1\\\msvc2019_64\\\bin;%PATH%`) You can also run a specific test (for example ``qpainter_test``) by running:: @@ -321,7 +321,7 @@ An example of the ``setup.py`` invocation might look like the following: --parallel=8 --ignore-git --reuse-build --standalone --limited-api=yes \ --cmake-toolchain-file=/opt/toolchain-aarch64.cmake \ --qt-host-path=/opt/Qt/6.3.0/gcc_64 \ - --plat-name=linux_aarch64 \ + --plat-name=linux_aarch64 Depending on the target platform, you could use ``linux_armv7``, ``linux_aarch64``, etc. @@ -431,7 +431,7 @@ The target executes several steps: #. ``sphinx`` is run to produce the documentation in HTML format. Re-running the command will not execute step 1 unless the file -``qdoc_output/webxml/qtcore-index.webxml`` is removed from the build tree. +``qdoc-output/webxml/qtcore-index.webxml`` is removed from the build tree. Similarly, step 2 will not be executed unless the file ``rst/PySide6/QtCore/index.rst`` is removed. @@ -457,12 +457,6 @@ Qt Assistant:: assistant -register PySide.qch -.. note:: Qt Assistant renders the QCH content using the QTextBrowser backend, which supports - a subset of the CSS styles, However, Qt Creator offers an alternative litehtml-based - backend, which offers better browsing experience. At the moment, this is not the default - backend, so you have to select the litehtml backend - explicitly under the ``General`` tab in ``Qt Creator >> Tools >> Options >> Help``. - Using the internal tools ------------------------ diff --git a/sources/pyside6/doc/porting_from2.rst b/sources/pyside6/doc/porting_from2.rst index aa3e41780..2d5c8414f 100644 --- a/sources/pyside6/doc/porting_from2.rst +++ b/sources/pyside6/doc/porting_from2.rst @@ -4,23 +4,17 @@ Porting Applications from PySide2 to PySide6 Module Availability ------------------- -Qt for Python 6.0.0 initially ships with the essential -`Modules `_ and some -add-ons (Qt 3D, Qt Concurrent, Qt Help, Qt OpenGL, Qt Print Support -Qt Quick Widgets, Qt SQL, Qt SVG, Qt UI Tools and Qt XML). - -More modules will follow in subsequent releases as they -are added to Qt. - -For Qt for Python 6.1, Active Qt, Qt Charts, Qt Data Visualization, -Qt StateMachine and Qt SCXML are planned. +Qt for Python 6.2.0 provides all modules planned for inclusion in Qt 6. Module-Level Changes -------------------- -* *Qt Quick Controls 1* have been removed. +* The modules *QtMacExtras*, *Qt Quick Controls 1*, *QtWinExtras*, + *QtXmlPatterns* and *QtX11Extras* have been removed. * ``QStateMachine`` and related classes have been extracted to a new *QtStateMachine* module. +* The modules *QtWebKit* and *QtWebKitWidgets* have been replaced by the new + *QtWebEngineCore*, *QtWebEngineQuick* and *QtWebEngineWidgets* modules. * ``QXmlReader`` and related classes (*SAX API*) have been removed. * The content of the *QtOpenGL* module has been replaced. The class ``QGLWidget`` and related classes (``QGLContext``, ``QGLFunctions``, @@ -97,4 +91,4 @@ accordingly. For example: More information can be found in the `Porting to Qt 6 `_ Guide -and the `Qt 6.0 Documentation `_ . +and the `Qt 6.2 Documentation `_ . diff --git a/sources/pyside6/doc/tutorials/basictutorial/signals_and_slots.rst b/sources/pyside6/doc/tutorials/basictutorial/signals_and_slots.rst index 470b4ab70..d22075812 100644 --- a/sources/pyside6/doc/tutorials/basictutorial/signals_and_slots.rst +++ b/sources/pyside6/doc/tutorials/basictutorial/signals_and_slots.rst @@ -185,7 +185,7 @@ the different functionality. speak = Signal((int,), (str,)) def __init__(self, parent=None): - super().__init__(self, parent) + super().__init__(parent) self.speak[int].connect(self.say_something) self.speak[str].connect(self.say_something) -- cgit v1.2.3 From 9c6d0451cee8b96486bc25a27bbb8769e300f970 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 8 Sep 2022 08:48:44 +0200 Subject: Documentation: Sort the modules page alphabetically Remove some duplication introduced by b81f75fa027076a65747109f2d8ddd9bd904d7dda. Change-Id: Iadc1c25ed63120ef360581c5565e72e20b3a996f Reviewed-by: Shyamnath Premnadh Reviewed-by: Christian Tismer Reviewed-by: Adrian Herrmann (cherry picked from commit 888b78ad9a2ddebaceda76b3d8f6cc80567b623f) Reviewed-by: Cristian Maureira-Fredes --- sources/pyside6/doc/modules.rst | 97 +++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 57 deletions(-) diff --git a/sources/pyside6/doc/modules.rst b/sources/pyside6/doc/modules.rst index a70540419..193e59d37 100644 --- a/sources/pyside6/doc/modules.rst +++ b/sources/pyside6/doc/modules.rst @@ -18,7 +18,6 @@ Qt Modules Supported by Qt for Python --- - :mod:`QtCharts ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -103,32 +102,16 @@ Qt Modules Supported by Qt for Python :mod:`Qt Network Authorization ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Provides support for OAuth-based authorization to online services. - - --- - - :mod:`QtNfc ` - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - The NFC API provides connectivity between NFC enabled devices. - - --- - - :mod:`QtNetworkAuth ` - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Provides a set of APIs that enable Qt applications to obtain limited access to online accounts and HTTP services without exposing users' passwords. --- - :mod:`QtRemoteObjects ` - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + :mod:`QtNfc ` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Inter-Process Communication (IPC) module developed for Qt. This module - extends Qt's existing functionalities to enable information exchange - between processes or computers, easily. + The NFC API provides connectivity between NFC enabled devices. --- @@ -147,13 +130,6 @@ Qt Modules Supported by Qt for Python --- - :mod:`QtOpenGLWidgets ` - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - The QOpenGLWidget class is a widget for rendering OpenGL graphics. - - --- - :mod:`Qt Positioning ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -196,6 +172,22 @@ Qt Modules Supported by Qt for Python --- + :mod:`QtRemoteObjects ` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + Inter-Process Communication (IPC) module developed for Qt. This module + extends Qt's existing functionalities to enable information exchange + between processes or computers, easily. + + --- + + :mod:`Qt Scxml ` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + Provides classes to create and use state machines from SCXML files. + + --- + :mod:`Qt Sensors ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -231,15 +223,6 @@ Qt Modules Supported by Qt for Python --- - :mod:`QtSerialPort ` - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - Provides the basic functionality, which includes configuring, I/O - operations, getting and setting the control signals of the RS-232 - pinouts. - - --- - :mod:`QtSvg ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -268,27 +251,6 @@ Qt Modules Supported by Qt for Python --- - :mod:`QtWidgets ` - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - Extends Qt GUI with C++ widget functionality. - - --- - - :mod:`QtXml ` - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - Provides a C++ implementation of DOM. - - --- - - :mod:`Qt3DAnimation ` - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - Provides basic elements required to animate 3D objects. - - --- - :mod:`Qt WebChannel ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -325,6 +287,27 @@ Qt Modules Supported by Qt for Python --- + :mod:`QtWidgets ` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + Extends Qt GUI with C++ widget functionality. + + --- + + :mod:`QtXml ` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + Provides a C++ implementation of DOM. + + --- + + :mod:`Qt3DAnimation ` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + Provides basic elements required to animate 3D objects. + + --- + :mod:`Qt3D Core ` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- cgit v1.2.3 From ba91461927bb71377e147830183aa6fcf2a72567 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 13 Sep 2022 09:08:21 +0200 Subject: Documentation/patch_qhp.py: Brush up script - Fix flake8 warnings - Warn about errors - Move line processing into a function for further extension - Make file a positional argument Change-Id: Ice191b8b78ff3a151581066ae0fc493ecb54fb64 Reviewed-by: Cristian Maureira-Fredes (cherry picked from commit 3b31a65a76de7f29f32c27201b35f5f3c17d14e5) Reviewed-by: Qt Cherry-pick Bot --- sources/pyside6/doc/CMakeLists.txt | 2 +- sources/shiboken6/doc/CMakeLists.txt | 2 +- sources/shiboken6/doc/scripts/patch_qhp.py | 63 ++++++++++++++++++------------ 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/sources/pyside6/doc/CMakeLists.txt b/sources/pyside6/doc/CMakeLists.txt index 61133c97a..93c4b995a 100644 --- a/sources/pyside6/doc/CMakeLists.txt +++ b/sources/pyside6/doc/CMakeLists.txt @@ -215,7 +215,7 @@ else() set(PATCH_QHP_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/../../shiboken6/doc/scripts/patch_qhp.py") file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/html/PySide.qhp QHP_FILE) add_custom_command(TARGET apidoc POST_BUILD - COMMAND ${python_executable} ${PATCH_QHP_SCRIPT} -f ${QHP_FILE} -v pyside6 + COMMAND ${python_executable} ${PATCH_QHP_SCRIPT} -v pyside6 ${QHP_FILE} COMMAND "${qhelpgenerator_binary}" ${QHP_FILE} COMMENT "Generating QCH from a QHP file..." VERBATIM diff --git a/sources/shiboken6/doc/CMakeLists.txt b/sources/shiboken6/doc/CMakeLists.txt index acf9acc94..0f909b3c5 100644 --- a/sources/shiboken6/doc/CMakeLists.txt +++ b/sources/shiboken6/doc/CMakeLists.txt @@ -41,7 +41,7 @@ if(SPHINX_BUILD) endif() add_custom_command(TARGET doc POST_BUILD - COMMAND "${python_executable}" ${PATCH_QHP_SCRIPT} -f ${QHP_FILE} -v shiboken6 + COMMAND "${python_executable}" ${PATCH_QHP_SCRIPT} -v shiboken6 ${QHP_FILE} COMMAND "${qhelpgenerator_binary}" ${QHP_FILE} COMMENT "Generating shiboken documentation QCH files based on the QHP files" VERBATIM) diff --git a/sources/shiboken6/doc/scripts/patch_qhp.py b/sources/shiboken6/doc/scripts/patch_qhp.py index a9f858889..9c7c875ae 100644 --- a/sources/shiboken6/doc/scripts/patch_qhp.py +++ b/sources/shiboken6/doc/scripts/patch_qhp.py @@ -39,31 +39,44 @@ import fileinput import re +import sys from argparse import ArgumentParser, RawTextHelpFormatter -options = ArgumentParser(description='Qhp file updater', - formatter_class=RawTextHelpFormatter) -options.add_argument('-f', - '--filename', - type=str, - help='Qhp filename with the relative path.', - required=True) -options.add_argument('-v', - '--vfolder', - type=str, - help='String to be injected into the Qhp file.') -args=options.parse_args() -try: - for line in fileinput.input(args.filename,inplace=True,backup='.bak'): - line_copy=line.strip() - if not line_copy: # check for empty line - continue - match=re.match('(^.*virtualFolder.)doc(.*$)',line) - if match: - repl=''.join([match.group(1), args.vfolder, match.group(2)]) - print(line.replace(match.group(0),repl),end=' ') - else: - print(line.rstrip()) -except: - pass +DESC="""Qhp file updater + +Replaces virtual folder ids in .qhp files preparing for +registering the documentation in Qt Assistant.""" + + +VIRTUAL_FOLDER_PATTERN = re.compile("(^.*virtualFolder.)doc(.*$)") + + +virtual_folder = "" + + +def process_line(line): + global virtual_folder + match = VIRTUAL_FOLDER_PATTERN.match(line) + if match: + print(f"{match.group(1)}{virtual_folder}{match.group(2)}") + return + sys.stdout.write(line) + + +if __name__ == '__main__': + arg_parser = ArgumentParser(description=DESC, + formatter_class=RawTextHelpFormatter) + arg_parser.add_argument('-v', '--vfolder', type=str, + help='String to be injected into the Qhp file.') + arg_parser.add_argument("file", type=str, help='Qhp filename.') + options = arg_parser.parse_args() + virtual_folder = options.vfolder + + try: + with fileinput.input(options.file, inplace=True, + backup=".bak") as fh: + for line in fh: + process_line(line) + except Exception as e: + print(f"WARNING: patch_qhp.py failed: {e}", file=sys.stderr) -- cgit v1.2.3