Skip to content

help

HelpCameraControlDialog #

Bases: QDialog

HelpCameraControlDialog class

Build a help modal for camera control.

Attributes:

Name Type Description
saved_geometry

Saved window position

closed Signal

Qt signal emitted when the window is hidden

Source code in cogip/widgets/help.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
class HelpCameraControlDialog(QtWidgets.QDialog):
    """HelpCameraControlDialog class

    Build a help modal for camera control.

    Attributes:
        saved_geometry: Saved window position
        closed: Qt signal emitted when the window is hidden
    """

    closed: qtSignal = qtSignal()

    def __init__(self, parent: QtWidgets.QWidget = None):
        """
        Class constructor.

        Arguments:
            parent: The parent widget
        """
        super().__init__(parent)

        self.setWindowTitle("Camera Control")
        self.setModal(False)

        layout = QtWidgets.QVBoxLayout()
        self.setLayout(layout)

        browser = QtWidgets.QTextBrowser()
        layout.addWidget(browser)

        browser.document().setMarkdown(help_text)

        self.resize(580, 395)

        self.readSettings()

    def closeEvent(self, event: QtGui.QCloseEvent):
        """
        Hide the window.

        Arguments:
            event: The close event (unused)
        """
        settings = QtCore.QSettings("COGIP", "monitor")
        settings.setValue("help/geometry", self.saveGeometry())

        self.closed.emit()
        event.accept()
        super().closeEvent(event)

    def readSettings(self):
        settings = QtCore.QSettings("COGIP", "monitor")
        self.restoreGeometry(settings.value("help/geometry"))

__init__(parent=None) #

Class constructor.

Parameters:

Name Type Description Default
parent QWidget

The parent widget

None
Source code in cogip/widgets/help.py
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
def __init__(self, parent: QtWidgets.QWidget = None):
    """
    Class constructor.

    Arguments:
        parent: The parent widget
    """
    super().__init__(parent)

    self.setWindowTitle("Camera Control")
    self.setModal(False)

    layout = QtWidgets.QVBoxLayout()
    self.setLayout(layout)

    browser = QtWidgets.QTextBrowser()
    layout.addWidget(browser)

    browser.document().setMarkdown(help_text)

    self.resize(580, 395)

    self.readSettings()

closeEvent(event) #

Hide the window.

Parameters:

Name Type Description Default
event QCloseEvent

The close event (unused)

required
Source code in cogip/widgets/help.py
60
61
62
63
64
65
66
67
68
69
70
71
72
def closeEvent(self, event: QtGui.QCloseEvent):
    """
    Hide the window.

    Arguments:
        event: The close event (unused)
    """
    settings = QtCore.QSettings("COGIP", "monitor")
    settings.setValue("help/geometry", self.saveGeometry())

    self.closed.emit()
    event.accept()
    super().closeEvent(event)