diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-11-02 16:11:52 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-11-02 16:12:04 +0000 |
| commit | 25180730194bec25f915f32ab846ea583fb1493f (patch) | |
| tree | 9a73e0336ecf21e085d99d6a651c5547b9eb99f8 /sources/pyside6/doc/examples | |
| parent | 6e3e7b9ca0548430aaa5e2555d6e02c64625fa3f (diff) | |
Rename PySide2 to PySide6
Adapt CMake files, build scripts, tests and examples.
Task-number: PYSIDE-904
Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/doc/examples')
| -rw-r--r-- | sources/pyside6/doc/examples/images/tabbedbrowser.png | bin | 0 -> 37147 bytes | |||
| -rw-r--r-- | sources/pyside6/doc/examples/index.rst | 14 | ||||
| -rw-r--r-- | sources/pyside6/doc/examples/tabbedbrowser.rst | 58 |
3 files changed, 72 insertions, 0 deletions
diff --git a/sources/pyside6/doc/examples/images/tabbedbrowser.png b/sources/pyside6/doc/examples/images/tabbedbrowser.png Binary files differnew file mode 100644 index 000000000..27c3daa09 --- /dev/null +++ b/sources/pyside6/doc/examples/images/tabbedbrowser.png diff --git a/sources/pyside6/doc/examples/index.rst b/sources/pyside6/doc/examples/index.rst new file mode 100644 index 000000000..069d54404 --- /dev/null +++ b/sources/pyside6/doc/examples/index.rst @@ -0,0 +1,14 @@ +|project| Examples +=================== + +A collection of examples are provided with |project| to help new users +to understand different use cases of the module. +You can find all the examples inside the ``pyside-setup`` on the ``examples`` +directory, or you can access them after installing |pymodname| from ``pip`` +inside the ``site-packages/PySide6/examples`` directory. + +.. toctree:: + :maxdepth: 1 + + tabbedbrowser.rst + ../pyside-examples/all-pyside-examples.rst diff --git a/sources/pyside6/doc/examples/tabbedbrowser.rst b/sources/pyside6/doc/examples/tabbedbrowser.rst new file mode 100644 index 000000000..c34c50647 --- /dev/null +++ b/sources/pyside6/doc/examples/tabbedbrowser.rst @@ -0,0 +1,58 @@ +********************** +Web Browser Example +********************** + +The example demonstrates the power and simplicity offered by |project| to developers. +It uses several |pymodname| submodules to offer a fluid and modern-looking UI that +is apt for a web browser. The application offers the following features: + + * Tab-based browsing experience using QTabWidget. + * Download manager using a QProgressBar and QWebEngineDownloadItem. + * Bookmark manager using QTreeView. + +.. image:: images/tabbedbrowser.png + +The application's code is organized in several parts for ease of maintenance. For example, +:code:`DownloadWidget` provides a widget to track progress of a download item. In the following +sections, these different parts are discussed briefly to help you understand the Python code behind +them a little better. + +BookmarkWidget or :code:`bookmarkwidget.py` +=========================================== + +This widget docks to the left of the main window by default. It inherits QTreeView and +loads a default set of bookmarks using a QStandardItemModel. The model is populated at startup +from a JSON file, which is updated when you add or remove bookmarks from the tree view. + +.. automodule:: bookmarkwidget + :members: + +DownloadWidget or :code:`downloadwidget.py` +============================================= + +The widget tracks progress of the download item. It inherits QProgressBar to display +progress of the QWebEngineDownloadItem instance, and offers a context-menu with actions such as Launch, +Show in folder, Cancel, and Remove. + +.. automodule:: downloadwidget + :members: + +BrowserTabWidget or :code:`browsertabwidget.py` +=============================================== + +The widget includes a QWebEngineView to enable viewing web content. It docks to the right +of BookmarkWidget in the main window. + +.. automodule:: browsertabwidget + :members: + +MainWindow or :code:`main.py` +============================= + +This is the parent window that collates all the other widgets together to offer the complete package. + +.. automodule:: main + :members: + + +Try running the example to explore it further. |
