aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKavindra Palaraja <kpalaraja@luxoft.com>2019-11-15 16:18:09 +0100
committerCristián Maureira-Fredes <cristian.maureira-fredes@qt.io>2019-12-04 17:19:03 +0100
commit6f79beb23aace35170d155517b9d901567a7f675 (patch)
treef4f5c36e3cac60c6943ee8f58ddd955fab3accee
parent3ce80d312f5da83d97674aff57e238e7a621ccb8 (diff)
docs: Simplify the Quick Start topic
Change-Id: I11651033783052591f38cd8eb02ec47719c91dbf Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--sources/pyside2/doc/pyside-examples/images/screenshot_hello.pngbin0 -> 21193 bytes
-rw-r--r--sources/pyside2/doc/quickstart.rst42
2 files changed, 19 insertions, 23 deletions
diff --git a/sources/pyside2/doc/pyside-examples/images/screenshot_hello.png b/sources/pyside2/doc/pyside-examples/images/screenshot_hello.png
new file mode 100644
index 000000000..41ebbf01b
--- /dev/null
+++ b/sources/pyside2/doc/pyside-examples/images/screenshot_hello.png
Binary files differ
diff --git a/sources/pyside2/doc/quickstart.rst b/sources/pyside2/doc/quickstart.rst
index a9288442f..5d8ddfe2d 100644
--- a/sources/pyside2/doc/quickstart.rst
+++ b/sources/pyside2/doc/quickstart.rst
@@ -4,17 +4,18 @@
Requirements
------------
-Before you can install |project|, you must install the following software:
+Before you can install |project|, first you must install the following software:
* Python 2.7 or 3.5+,
- * Recommended: a virtual environment, such as
+ * We recommend using a virtual environment, such as
`venv <https://docs.python.org/3/library/venv.html>`_ or
`virtualenv <https://virtualenv.pypa.io/en/stable/installation>`_
Installation
------------
-Run the following command from your command prompt to install::
+Now you are ready to install the |project| packages using ``pip``.
+From the terminal, run the following command::
pip install PySide2 # For the latest version on PyPi
@@ -22,8 +23,8 @@ or::
pip install --index-url=http://download.qt.io/snapshots/ci/pyside/5.14/latest pyside2 --trusted-host download.qt.io
-Testing the Installation
--------------------------
+Test your Installation
+----------------------
Now that you have |project| installed, you can test your setup by running the following Python
constructs to print version information::
@@ -46,16 +47,14 @@ constructs to print version information::
# e.g. (5, 11, 2)
print(PySide2.QtCore.__version_info__)
-Creating a Simple Application
-------------------------------
+Create a Simple Application
+---------------------------
-Your |project| setup is ready, so try exploring it further by developing a simple application
+Your |project| setup is ready. You can explore 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.
-
- ::
+1. Create a new file named :code:`hello_world.py`, and add the following imports to it.::
import sys
import random
@@ -64,9 +63,8 @@ guide you through the development process:
The |pymodname| Python module provides access to the Qt APIs as its submodule.
In this case, you are importing the :code:`QtCore`, :code:`QtWidgets`, and :code:`QtGui` submodules.
-* Define a class named :code:`MyWidget`, which extends QWidget and includes a QPushButton and QLabel.
-
- ::
+2. Define a class named :code:`MyWidget`, which extends QWidget and includes a QPushButton and
+ QLabel.::
class MyWidget(QtWidgets.QWidget):
def __init__(self):
@@ -89,14 +87,10 @@ guide you through the development process:
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.
+ The MyWidget class has the :code:`magic` member function that randomly chooses an item from the
+ :code:`hello` list. When you click the button, the :code:`magic` function is called.
-* Now, add a main function where you instantiate :code:`MyWidget` and
- :code:`show` it.
-
- ::
+3. Now, add a main function where you instantiate :code:`MyWidget` and :code:`show` it.::
if __name__ == "__main__":
app = QtWidgets.QApplication([])
@@ -107,5 +101,7 @@ guide you through the development process:
sys.exit(app.exec_())
-Your example is ready to be run. Try clicking the button at the bottom
-and see which greeting you get.
+Run your example. Try clicking the button at the bottom to see which greeting you get.
+
+.. image:: pyside-examples/images/screenshot_hello.png
+ :alt: Hello World application