aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/doc/tutorials/examples/tabbedbrowser.rst
diff options
context:
space:
mode:
authorVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2018-05-28 17:07:03 +0200
committerVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2018-06-01 20:04:04 +0000
commit3b57289e6d8040bbb6747494bcc754bcd8751dfe (patch)
treeb64d93595dd8d5d47f3911b914ad926cdf276e0c /sources/pyside2/doc/tutorials/examples/tabbedbrowser.rst
parent7f798dfc9fc6e3e9756f06f0fedc821e16f1320a (diff)
Doc: Document the tabbed browser demo
- Added docstrings to the examples sources to autogenerate the docs for the different parts. - Updated the conf.py.in to include sphinx.ext.viewcode to generate html for every source file of the example. Change-Id: I668c55070556ca49d12d38c8ec83f09313bffc36 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside2/doc/tutorials/examples/tabbedbrowser.rst')
-rw-r--r--sources/pyside2/doc/tutorials/examples/tabbedbrowser.rst57
1 files changed, 57 insertions, 0 deletions
diff --git a/sources/pyside2/doc/tutorials/examples/tabbedbrowser.rst b/sources/pyside2/doc/tutorials/examples/tabbedbrowser.rst
new file mode 100644
index 000000000..8a2e03110
--- /dev/null
+++ b/sources/pyside2/doc/tutorials/examples/tabbedbrowser.rst
@@ -0,0 +1,57 @@
+**********************
+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 is a widget that 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
+for a JSON file, which is updated when you add or remove bookmarks from the tree view.
+
+.. automodule:: bookmarkwidget
+ :members:
+
+DownloadWidget or :code:`downloadwidget.py`
+=============================================
+
+This is a widget that 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`
+===============================================
+
+This is a widget that includes a QWebEngineView to enable viewing web pages. 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.