vdat.gui.help_window – The offline help window

class vdat.gui.help_window.HelpBrowser(help_engine, parent=None)[source]

Bases: PyQt5.QtWidgets.QTextBrowser

Custom QTextBrowser that can deal with documentation and external links

Custom slot
Name Signature Description
setSource() PyQt5.QtCore.QUrl if the input url is http/https opens in the default internet browser, other wise pass it further
Parameters:
help_engine : PyQt5.QtHelp.QHelpEngine

help engine containing the documentation

setSource(url)[source]

Reimplement slot to properly handle http/https links via PyQt5.QtGui.QDesktopServices.openUrl(). All the other types are passed to the original implementation.

Parameters:
url : PyQt5.QtCore.QUrl

url that has being clicked

Returns:
resource to show
loadResource(type_, url)[source]

Reimplement the method to get qthelp urls from the help engine. All the other types are passed unchanged to the original implementation.

Parameters:
type_ : int

ignored

url : PyQt5.QtCore.QUrl

url that has being clicked

Returns:
resources to show
class vdat.gui.help_window.HelpWidget(parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

Create a widget containing the offline help.

Custom slot
Name Signature Description
expand_and_set()   show the first page of the documentation and expand the first level of the content
on_click_content() PyQt5.QtCore.QModelIndex Extract the url of the selected item and send it to HelpBrowser for displaying
Connections between custom signals and/or slots
Signal Slot
PyQt5.QtHelp.QHelpContentModel.contentsCreated expand_and_set()
PyQt5.QtHelp.QHelpContentWidget.clicked on_click_content()
PyQt5.QtHelp.QHelpIndexWidget.linkActivated HelpBrowser.setSource()
Parameters:
parent : PyQt5.QtWidgets.QWidget instance

parent of the menu’ bar

setup()[source]

Setup the gui elements into a resizable splitter and connect all the signals

expand_and_set()[source]

Custom slot: it gets the index of the first element, set it as first page in the help browser and expand the sections below it.

on_click_content(index)[source]

Custom slot: receive the clicked index in the content tree, get the underlying url and send it to the HelpBrowser

Parameters:
index : PyQt5.QtCore.QModelIndex

index of the selected item

class vdat.gui.help_window.HelpWindow(parent=None)[source]

Bases: PyQt5.QtWidgets.QMainWindow

Window wrapping the HelpWidget

Parameters:
parent : PyQt5.QtWidgets.QWidget instance

parent of the menu’ bar