diff options
author | Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> | 2018-03-14 14:29:19 +0100 |
---|---|---|
committer | Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> | 2018-04-27 12:42:47 +0000 |
commit | 76f1ae210a14d57174c429e50df519dfe6d350d0 (patch) | |
tree | 5efe6dd8d704f7582a156d029e87620f6c46cfcc /sources/pyside2 | |
parent | 4035c45e58896329e5b8b72913ff7f30d387c3dc (diff) |
Doc: Add top-level index and getting started information
- Updated the copyright text in the config file
- Added the copyright to the footer in the template
Change-Id: Iaadc293af524abea41873d04206516caec189c53
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside2')
-rw-r--r-- | sources/pyside2/doc/_templates/layout.html | 1 | ||||
-rw-r--r-- | sources/pyside2/doc/conf.py.in | 9 | ||||
-rw-r--r-- | sources/pyside2/doc/contents.rst | 5 | ||||
-rw-r--r-- | sources/pyside2/doc/gettingstarted.rst | 86 | ||||
-rw-r--r-- | sources/pyside2/doc/index.rst | 94 | ||||
-rw-r--r-- | sources/pyside2/doc/modules.rst | 19 | ||||
-rw-r--r-- | sources/pyside2/doc/pysideapi2.rst | 5 | ||||
-rw-r--r-- | sources/pyside2/doc/pysideversion.rst | 14 |
8 files changed, 210 insertions, 23 deletions
diff --git a/sources/pyside2/doc/_templates/layout.html b/sources/pyside2/doc/_templates/layout.html index d2eb1d08d..561bed8ee 100644 --- a/sources/pyside2/doc/_templates/layout.html +++ b/sources/pyside2/doc/_templates/layout.html @@ -28,6 +28,7 @@ <div class="footer"> <a href="http://www.qt.io/"><img src="{{ pathto('_static/logo_qt.png', 1) }}" alt="Qt" border="0" /></a> <a href="http://www.python.org"><img src="{{ pathto('_static/logo_python.jpg', 1) }}" alt="Python" border="0" /></a> + <p>{{ copyright }}</p> </div> </div> {%- endblock %} diff --git a/sources/pyside2/doc/conf.py.in b/sources/pyside2/doc/conf.py.in index c0ae45fd3..21ce43ad2 100644 --- a/sources/pyside2/doc/conf.py.in +++ b/sources/pyside2/doc/conf.py.in @@ -39,12 +39,11 @@ source_suffix = '.rst' source_encoding = 'utf-8' # The master toctree document. -master_doc = 'contents' +master_doc = 'index' # General information about the project. project = u'PySide' -copyright = u'2009-2011, Nokia Corporation' - +copyright = u'© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/license/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. @@ -109,7 +108,7 @@ html_theme_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_themes'] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". -#html_title = None +html_title = u'PySide2 documentation' # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None @@ -137,7 +136,7 @@ html_theme_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_themes'] # Additional templates that should be rendered to pages, maps page names to # template names. -html_additional_pages = { 'index' : 'index.html'} +#html_additional_pages = { 'index' : 'index.html'} # If false, no module index is generated. #html_use_modindex = True diff --git a/sources/pyside2/doc/contents.rst b/sources/pyside2/doc/contents.rst index c2ea806a2..9ba3663f8 100644 --- a/sources/pyside2/doc/contents.rst +++ b/sources/pyside2/doc/contents.rst @@ -1,9 +1,10 @@ -PySide Documentation contents -***************************** +Qt for Python Documentation +*************************** .. toctree:: :maxdepth: 2 + gettingstarted.rst modules.rst Tutorials diff --git a/sources/pyside2/doc/gettingstarted.rst b/sources/pyside2/doc/gettingstarted.rst new file mode 100644 index 000000000..bb58c1734 --- /dev/null +++ b/sources/pyside2/doc/gettingstarted.rst @@ -0,0 +1,86 @@ +=============== +Getting Started +=============== + +To get started with |project|, install the following prerequisites: + +* Python v3.5 or later +* libclang v3.9 or later +* Optional: a virtual environment, such as `venv <https://docs.python.org/3/library/venv.html>`_ or `virtualenv <https://virtualenv.pypa.io/en/stable/installation>`_ + +With these installed, you are ready to install the |project| +packages using the pip wheel. Run the following command from your command +prompt to install:: + + python -m pip install --index-url=http://download.qt.io/snapshots/ci/pyside/5.9/latest pyside2 --trusted-host download.qt.io + +Now that you have |project| installed, you can test your setup by running the following Python +constructs to print version information: + +.. include:: pysideversion.rst + :start-line: 5 + :end-line: 32 + +Your |project| setup is ready, so try exploring it further by developing a simple application +that prints "Hello World" in several languages. The following instructions will +guide you through the development process: + +* Create a new file named :code:`hello_world.py`, and add the following imports to it. + + :: + + import sys + import random + from PySide2 import QtCore, QtWidgets, QtGui + + These imports should provide access to the APIs specific to those Qt modules. + +* Define a class named :code:`MyWidget`, which extends QWidget and includes a QPushButton and QLabel. + + :: + + class MyWidget(QtWidgets.QWidget): + def __init__(self): + super().__init__() + + self.hello = ["Hallo Welt", "你好,世界", "Hei maailma",\ + "Hola Mundo", "Привет мир"] + + self.button = QtWidgets.QPushButton("Click me!") + self.text = QtWidgets.QLabel("Hello World") + self.text.setAlignment(QtCore.Qt.AlignCenter) + + self.text.setFont(QtGui.QFont("Titillium", 30)) + self.button.setFont(QtGui.QFont("Titillium", 20)) + + self.layout = QtWidgets.QVBoxLayout() + self.layout.addWidget(self.text) + self.layout.addWidget(self.button) + self.setLayout(self.layout) + + self.button.clicked.connect(self.magic) + + + def magic(self): + self.text.setText(random.choice(self.hello)) + + The MyWidget class has the :code:`magic` member function that + randomly chooses an item from the list :code:`hello`. This function + is called when you click the button. + +* Now, add a main function where you instantiate :code:`MyWidget` and + :code:`show` it. + + :: + + if __name__ == "__main__": + app = QtWidgets.QApplication([]) + + widget = MyWidget() + widget.resize(800, 600) + widget.show() + + sys.exit(app.exec_()) + +Your example is ready to be run. Try clicking the button at the bottom +and see which greeting you get. diff --git a/sources/pyside2/doc/index.rst b/sources/pyside2/doc/index.rst new file mode 100644 index 000000000..47437d986 --- /dev/null +++ b/sources/pyside2/doc/index.rst @@ -0,0 +1,94 @@ +|project| +************* + +|project| enables the use of Qt 5 APIs in Python applications. It lets Python +developers utilize the full power of Qt. The following Qt5 modules are supported: + +Qt Modules +=========== + +.. list-table:: + :widths: 150, 150 + :align: left + + * - `Qt Core <PySide2/QtCore/index.html>`_ + Provides core non-GUI functionality. + - `Qt 3D Animation <PySide2/Qt3DAnimation/index.html>`_ + Provides basic elements required to animate 3D objects. + * - `Qt Gui <PySide2/QtGui/index.html>`_ + Extends QtCore with GUI functionality. + - `Qt Help <PySide2/QtHelp/index.html>`_ + Provides classes for integrating online documentation in applications. + * - `Qt Network <PySide2/QtNetwork/index.html>`_ + Offers classes that lets you to write TCP/IP clients and servers. + - `Qt OpenGL <PySide2/QtCore/index.html>`_ + Offers classes that make it easy to use OpenGL in Qt applications. + * - `Qt PrintSupport <PySide2/QtPrintSupport/index.html>`_ + Offers classes that make it easy to use OpenGL in Qt applications. + - `Qt Qml <PySide2/QtQml/index.html>`_ + Python API for Qt QML. + * - `Qt Charts <PySide2/QtCharts/index.html>`_ + Provides a set of easy to use chart components. + - `Qt Quick <PySide2/QtQuick/index.html>`_ + Provides classes for embedding Qt Quick in Qt applications. + * - `Qt DataVisualization <PySide2/QtDataVisualization/index.html>`_ + Provides a way to visualize data in 3D as bar, scatter, and surface graphs. + - `Qt QuickWidgets <PySide2/QtQuickWidgets/index.html>`_ + Provides the QQuickWidget class for embedding Qt Quick in widget-based applications. + * - `Qt TextToSpeech <PySide2/QtTextToSpeech/index.html>`_ + Provides API to access text-to-speech engines. + - `Qt Sql <PySide2/QtSql/index.html>`_ + Helps you provide seamless database integration to your Qt applications. + * - `Qt Multimedia <PySide2/QtMultimedia/index.html>`_ + Provides low-level multimedia functionality. + - `Qt MultimediaWidgets <PySide2/QtMultimediaWidgets/index.html>`_ + Provides the widget-based multimedia API. + * - `Qt MacExtras <PySide2/QtMacExtras/index.html>`_ + Provides classes and functions specific to + macOS and iOS operating systems. + - `Qt Svg <PySide2/QtSvg/index.html>`_ + Provides classes for displaying the contents of SVG files. + * - `Qt UiTools <PySide2/QtUiTools/index.html>`_ + Provides classes to handle forms created with Qt Designer. + - `Qt Test <PySide2/QtTest/index.html>`_ + Provides classes for unit testing Qt applications and libraries. + * - `Qt Concurrent <PySide2/QtConcurrent/index.html>`_ + Provides high-level APIs that make it possible + to write multi-threaded programs without using low-level threading + primitives such as mutexes, read-write locks, wait conditions, or semaphores. + - `Qt AxContainer <PySide2/QtAxContainer/index.html>`_ + Provides QAxObject and QAxWidget which act as + containers for COM objects and ActiveX controls. + * - `Qt WebChannel <PySide2/QtWebChannel/index.html>`_ + Enables peer-to-peer communication between a server and a client + (HTML/JavaScript or QML application). + - `Qt WebSockets <PySide2/QtWebSockets/index.html>`_ + Provides interfaces that enable Qt applications + to act as a server that can process WebSocket requests, or a client that + can consume data received from the server, or both. + * - `Qt Widgets <PySide2/QtWidgets/index.html>`_ + Extends Qt GUI with C++ widget functionality. + - `Qt WinExtras <PySide2/QtWinExtras/index.html>`_ + Provides classes and functions for using some Windows APIs in a Qt way. + * - `Qt X11Extras <PySide2/QtX11Extras/index.html>`_ + Provides information about the X display configuration. + - `Qt Xml <PySide2/QtXml/index.html>`_ + Provides a stream reader and writer for XML documents. + * - `Qt XmlPatterns <PySide2/QtXmlPatterns/index.html>`_ + Provides support for XPath, XQuery, XSLTi, and XML Schema validation. + - `Qt 3D Core <PySide2/Qt3DCore/index.html>`_ + Contains functionality to support near-realtime simulation systems. + * - `Qt 3D Extras <PySide2/Qt3DExtras/index.html>`_ + Provides a set of prebuilt elements to help you get started with Qt 3D. + - `Qt 3D Input <PySide2/Qt3DInput/index.html>`_ + Provides classes for handling user input in applications using Qt 3D. + * - `Qt 3D Logic <PySide2/Qt3DLogic/index.html>`_ + Enables synchronizing frames with the Qt 3D backend. + - `Qt 3D Render <PySide2/Qt3DRender/index.html>`_ + Contains functionality to support 2D and 3D rendering using Qt 3D. + + +.. toctree:: + :maxdepth: 2 + + contents.rst diff --git a/sources/pyside2/doc/modules.rst b/sources/pyside2/doc/modules.rst index 3bf0f2abb..0ec1fb77d 100644 --- a/sources/pyside2/doc/modules.rst +++ b/sources/pyside2/doc/modules.rst @@ -1,21 +1,28 @@ -PySide modules -************** +|project| modules +******************* -Qt is splitted in several modules. +Qt is split into several modules. .. toctree:: :maxdepth: 1 + PySide2/Qt3DAnimation/index.rst + PySide2/Qt3DCore/index.rst + PySide2/Qt3DExtras/index.rst + PySide2/Qt3DInput/index.rst + PySide2/Qt3DLogic/index.rst + PySide2/Qt3DRender/index.rst PySide2/QtCore/index.rst PySide2/QtGui/index.rst PySide2/QtHelp/index.rst PySide2/QtMultimedia/index.rst PySide2/QtNetwork/index.rst PySide2/QtOpenGL/index.rst - PySide2/QtScript/index.rst - PySide2/QtScriptTools/index.rst + PySide2/QtPrintSupport/index.rst + PySide2/QtQml/index.rst + PySide2/QtQuick/index.rst PySide2/QtSql/index.rst PySide2/QtSvg/index.rst PySide2/QtUiTools/index.rst PySide2/QtXml/index.rst - PySide2/QtWebKit/index.rst + PySide2/QtXmlPatterns/index.rst diff --git a/sources/pyside2/doc/pysideapi2.rst b/sources/pyside2/doc/pysideapi2.rst index e86be05c9..5769ca83b 100644 --- a/sources/pyside2/doc/pysideapi2.rst +++ b/sources/pyside2/doc/pysideapi2.rst @@ -1,8 +1,7 @@ - .. _pysideapi2: -PySide API 2 -************ +|project| API +*************** Since the beginning one of the PySide goals was to be API compatible with PyQt4, but with some (documented) exceptions. For example, PySide will not export to diff --git a/sources/pyside2/doc/pysideversion.rst b/sources/pyside2/doc/pysideversion.rst index 5ad308c1e..24afba12d 100644 --- a/sources/pyside2/doc/pysideversion.rst +++ b/sources/pyside2/doc/pysideversion.rst @@ -1,9 +1,10 @@ -Getting PySide and Qt version -***************************** +Printing |project| and Qt version +********************************* -PySide exports their version numbers among the version of Qt used to compile PySide in a pythonic way, you can check it using the variables: +|project| exports its version numbers in a pythonic way. You can print these +numbers using the following python constructs: -:: + :: import PySide2.QtCore @@ -24,8 +25,7 @@ PySide exports their version numbers among the version of Qt used to compile PyS print(PySide2.QtCore.__version_info__) -Note that the Qt version used to compile PySide may differ from the version used to run PySide, to get the current running Qt version you can do: - -:: +Note that the Qt version used to compile |project| may differ from the version used to +run |project|. To print the current running Qt version number, you can use:: print(PySide2.QtCore.qVersion()) |