aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-12-16 09:11:13 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-12-16 09:11:13 +0100
commita3e70f98630f79c1857fd45b1be3272e966bfb7d (patch)
tree485e33fa1b73ee1e48eb7e56b75041f426589126 /sources/pyside2
parentd73b75b08dc3f5998697d0f4936122c2a109b3cb (diff)
parent3a9ae5af078203b164a15b9fc4e9a726b84c849e (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'sources/pyside2')
-rw-r--r--sources/pyside2/doc/api.rst1
-rw-r--r--sources/pyside2/doc/contents.rst2
-rw-r--r--sources/pyside2/doc/deployment-fbs.rst2
-rw-r--r--sources/pyside2/doc/extras/QtCore.ClassInfo.rst2
-rw-r--r--sources/pyside2/doc/extras/QtCore.Property.rst62
-rw-r--r--sources/pyside2/doc/extras/QtCore.Signal.rst2
-rw-r--r--sources/pyside2/doc/extras/QtCore.Slot.rst2
-rw-r--r--sources/pyside2/doc/gettingstarted-linux.rst20
-rw-r--r--sources/pyside2/doc/gettingstarted-macOS.rst18
-rw-r--r--sources/pyside2/doc/gettingstarted-windows.rst31
-rw-r--r--sources/pyside2/doc/index.rst9
-rw-r--r--sources/pyside2/doc/tutorials/expenses/expenses.rst2
12 files changed, 120 insertions, 33 deletions
diff --git a/sources/pyside2/doc/api.rst b/sources/pyside2/doc/api.rst
index 34d065f49..2cc258c75 100644
--- a/sources/pyside2/doc/api.rst
+++ b/sources/pyside2/doc/api.rst
@@ -1,4 +1,5 @@
.. _pyside-api:
+
|project| Modules
=================
diff --git a/sources/pyside2/doc/contents.rst b/sources/pyside2/doc/contents.rst
index 2a6f08266..598a65c92 100644
--- a/sources/pyside2/doc/contents.rst
+++ b/sources/pyside2/doc/contents.rst
@@ -11,6 +11,8 @@
examples/index.rst
videos.rst
deployment.rst
+ licenses.rst
+ modules.rst
considerations.rst
shiboken2/index.rst
diff --git a/sources/pyside2/doc/deployment-fbs.rst b/sources/pyside2/doc/deployment-fbs.rst
index 311c78ac7..0a75f2c4d 100644
--- a/sources/pyside2/doc/deployment-fbs.rst
+++ b/sources/pyside2/doc/deployment-fbs.rst
@@ -1,7 +1,7 @@
|project| & fbs
####################
-`fbs`_ provides a powerful environment for packaging,
+``fbs`` provides a powerful environment for packaging,
creating installers, and signing your application. It also lets you manage updates to
your application. As it is based on PyInstaller, it supports Linux, macOS, and Windows.
diff --git a/sources/pyside2/doc/extras/QtCore.ClassInfo.rst b/sources/pyside2/doc/extras/QtCore.ClassInfo.rst
index d2267be9c..89ca926c7 100644
--- a/sources/pyside2/doc/extras/QtCore.ClassInfo.rst
+++ b/sources/pyside2/doc/extras/QtCore.ClassInfo.rst
@@ -1,4 +1,4 @@
-.. module:: PySide2.QtCore
+.. currentmodule:: PySide2.QtCore
.. _ClassInfo:
ClassInfo
diff --git a/sources/pyside2/doc/extras/QtCore.Property.rst b/sources/pyside2/doc/extras/QtCore.Property.rst
new file mode 100644
index 000000000..209704c46
--- /dev/null
+++ b/sources/pyside2/doc/extras/QtCore.Property.rst
@@ -0,0 +1,62 @@
+.. currentmodule:: PySide2.QtCore
+.. _Property:
+Property
+********
+
+Detailed Description
+--------------------
+
+The Property function lets you declare properties that
+behave both as Qt and Python properties, and have their
+setters and getters defined as Python functions.
+
+Here is an example that illustrates how to use this
+function:
+
+.. code-block::
+ :linenos:
+
+from PySide2.QtCore import QObject, Property
+
+class MyObject(QObject):
+ def __init__(self,startval=42):
+ QObject.__init__(self)
+ self.ppval = startval
+
+ def readPP(self):
+ return self.ppval
+
+ def setPP(self,val):
+ self.ppval = val
+
+ pp = Property(int, readPP, setPP)
+
+obj = MyObject()
+obj.pp = 47
+print(obj.pp)
+
+Properties in QML expressions
+-----------------------------
+
+If you are using properties of your objects in QML expressions,
+QML requires that the property changes are notified. Here is an
+example illustrating how to do this:
+
+.. code-block::
+ :linenos:
+
+from PySide2.QtCore import QObject, Signal, Property
+
+class Person(QObject):
+ def __init__(self, name):
+ QObject.__init__(self)
+ self._person_name = name
+
+ def _name(self):
+ return self._person_name
+
+ @Signal
+ def name_changed(self):
+ pass
+
+ name = Property(str, _name, notify=name_changed)
diff --git a/sources/pyside2/doc/extras/QtCore.Signal.rst b/sources/pyside2/doc/extras/QtCore.Signal.rst
index 16c640831..a0660f88f 100644
--- a/sources/pyside2/doc/extras/QtCore.Signal.rst
+++ b/sources/pyside2/doc/extras/QtCore.Signal.rst
@@ -1,4 +1,4 @@
-.. module:: PySide2.QtCore
+.. currentmodule:: PySide2.QtCore
.. _Signal:
Signal
diff --git a/sources/pyside2/doc/extras/QtCore.Slot.rst b/sources/pyside2/doc/extras/QtCore.Slot.rst
index 3bc64c03a..5a59a2ae3 100644
--- a/sources/pyside2/doc/extras/QtCore.Slot.rst
+++ b/sources/pyside2/doc/extras/QtCore.Slot.rst
@@ -1,4 +1,4 @@
-.. module:: PySide2.QtCore
+.. currentmodule:: PySide2.QtCore
.. _Slot:
Slot
diff --git a/sources/pyside2/doc/gettingstarted-linux.rst b/sources/pyside2/doc/gettingstarted-linux.rst
index fd5b83223..6192ab190 100644
--- a/sources/pyside2/doc/gettingstarted-linux.rst
+++ b/sources/pyside2/doc/gettingstarted-linux.rst
@@ -4,19 +4,25 @@ Getting Started on Linux
Requirements
------------
- * Qt package from `here`_ or a custom build of Qt (preferably Qt 5.12 or greater)
+ * Qt package from `here`_ or a custom build of Qt (preferably
+ Qt 5.12 or greater)
* A Python interpreter (version Python 3.5+ or Python 2.7).
-
- * You can use the one provided by your OS, or you can get python from the `official website`_.
- * GCC,
+ You can either use the one provided by your OS, or get it
+ from the `official website`_.
+ * GCC
* `CMake`_ version 3.1 or greater
* Git version 2 or greater
- * `libclang_` from your system or from the `precompiled Qt packages`_ is recommended.
+ * `libclang`_ from your system or the prebuilt version from the
+ ``Qt Downloads`` page is recommended.
* ``virtualenv`` is strongly recommended, but optional.
* ``sphinx`` package for the documentation (optional).
- * Depending on your OS, other dependencies packages might be required:
+ * Depending on your linux distribution, the following dependencies might
+ also be required:
- * ``libgl-dev, python-dev, python-distutils, and python-setuptools``.
+ * ``libgl-dev``,
+ * ``python-dev``,
+ * ``python-distutils``,
+ * and ``python-setuptools``.
.. _here: https://qt.io/download
.. _official website: https://www.python.org/downloads/
diff --git a/sources/pyside2/doc/gettingstarted-macOS.rst b/sources/pyside2/doc/gettingstarted-macOS.rst
index 11305247f..fa6fc6037 100644
--- a/sources/pyside2/doc/gettingstarted-macOS.rst
+++ b/sources/pyside2/doc/gettingstarted-macOS.rst
@@ -4,19 +4,25 @@ Getting Started on macOS
Requirements
------------
- * Qt package from `here`_ or a custom build of Qt (preferably Qt 5.12 or greater)
+ * Qt package from `here`_ or a custom build of Qt (preferably
+ Qt 5.12 or greater)
* A Python interpreter (version Python 3.5+ or Python 2.7).
-
- * You can use the one provided by HomeBrew, or you can get python from the `official website`_.
+ You can use the one provided by HomeBrew, or you can get
+ python from the `official website`_.
* `XCode`_ 8.2 (macOS 10.11), 8.3.3 (macOS 10.12), 9 (macOS 10.13), 10.1 (macOS 10.14)
* `CMake`_ version 3.1 or greater
* Git version 2 or greater
- * `libclang_` from your system or from the `precompiled Qt packages`_ is recommended.
+ * `libclang`_ from your system or the prebuilt version from the
+ ``Qt Downloads`` page is recommended.
* ``virtualenv`` is strongly recommended, but optional.
* ``sphinx`` package for the documentation (optional).
- * Depending on your OS, other dependencies packages might be required:
+ * Depending on your OS, the following dependencies might also
+ be required:
- * ``libgl-dev, python-dev, python-distutils, and python-setuptools``.
+ * ``libgl-dev``,
+ * ``python-dev``,
+ * ``python-distutils``,
+ * and ``python-setuptools``.
.. _XCode: https://developer.apple.com/xcode/
.. _here: https://qt.io/download
diff --git a/sources/pyside2/doc/gettingstarted-windows.rst b/sources/pyside2/doc/gettingstarted-windows.rst
index dea781545..8de20769e 100644
--- a/sources/pyside2/doc/gettingstarted-windows.rst
+++ b/sources/pyside2/doc/gettingstarted-windows.rst
@@ -7,27 +7,28 @@ selected when using the online installer.
Requirements
------------
- * Qt package from `here`_ or a custom build of Qt (preferably Qt 5.12 or greater)
- * A Python interpreter (version Python 3.5+).
-
- * Preferably get python from the `official website`_.
-
- .. note:: Python 2.7 interpreter is not supported.
- The official Python 2.7 binary package which can be downloaded at
- https://www.python.org/downloads/ is built using MSVC 2007, while
- the Qt libraries are built using MSVC 2015/2017.
- Note that if you build your own custom Python2.7 interpreter with
- an MSVC version equivalent to the one that Qt was built with,
- you can safely build and use Qt for Python against that interpreter.
-
+ * Qt package from `here`_ or a custom build of Qt (preferably Qt 5.12
+ or greater)
+ * A Python interpreter (version Python 3.5+). Preferably get it
+ from the `official website`_.
* `MSVC2017`_ (or MSVC2019) for Python 3 on Windows,
* `CMake`_ version 3.1 or greater
* `Git`_ version 2 or greater
- * `libclang_` from the `precompiled Qt packages`_ is recommended.
- * `OpenSSL`_ (optional for SSL support, Qt must have been configured using the same SSL library)
+ * `libclang`_ prebuilt version from the
+ ``Qt Downloads`` page is recommended.
+ * `OpenSSL`_ (optional for SSL support, Qt must have been
+ configured using the same SSL library).
* ``virtualenv`` is strongly recommended, but optional.
* ``sphinx`` package for the documentation (optional).
+.. note:: Python 2.7 interpreter is not supported.
+ The official Python 2.7 binary package offerred on the
+ `official website`_ is built using MSVC 2007, while
+ the Qt libraries are built using MSVC 2015/2017.
+ If you intend to use Python 2.7, build the interpreter yourself
+ with MSVC 2015 or later, and build Qt for Python with it.
+
+
.. _here: https://qt.io/download
.. _official website: https://www.python.org/downloads/
.. _MSVC2017: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools
diff --git a/sources/pyside2/doc/index.rst b/sources/pyside2/doc/index.rst
index 5ffe405a5..93e3451c5 100644
--- a/sources/pyside2/doc/index.rst
+++ b/sources/pyside2/doc/index.rst
@@ -40,3 +40,12 @@ Documentation
<td><a href="shiboken2/index.html" style="display: block;"><p><strong>Shiboken</strong><br/>Generate C++ to Python binding.</p></a></td>
</tr>
</table>
+
+.. toctree::
+ :hidden:
+ :glob:
+
+ contents.rst
+ gettingstarted*
+ pyside-examples/pyside2examples*
+ overviews/*
diff --git a/sources/pyside2/doc/tutorials/expenses/expenses.rst b/sources/pyside2/doc/tutorials/expenses/expenses.rst
index a19cec5c3..f643ec299 100644
--- a/sources/pyside2/doc/tutorials/expenses/expenses.rst
+++ b/sources/pyside2/doc/tutorials/expenses/expenses.rst
@@ -32,7 +32,7 @@ The base structure for a `QApplication` is located inside the `if __name__ == "_
code block.
.. code-block:: python
- :dedent: 4
+ :linenos:
if __name__ == "__main__":
app = QApplication([])