Added a lot of comments to functions in the source code

This commit is contained in:
Veronica K. B. Olsen
2020-05-24 16:42:28 +02:00
parent e1ce93416c
commit c865dbd59b
21 changed files with 273 additions and 82 deletions
+9 -1
View File
@@ -69,10 +69,14 @@ class PagedDialog(QDialog):
return
def addTab(self, tabWidget, tabLabel):
"""Forwards the adding of tabs to the QTabWidget.
"""
self._tabBox.addTab(tabWidget, tabLabel)
return
def addControls(self, buttonBar):
"""Adds a button bar to the dialog.
"""
self._buttonBox.addWidget(buttonBar)
return
@@ -85,12 +89,16 @@ class VerticalTabBar(QTabBar):
return
def tabSizeHint(self, theIndex):
"""Returns a transposed size hint for the rotated bar.
"""
tSize = QTabBar.tabSizeHint(self, theIndex)
tSize.transpose()
return tSize
def paintEvent(self, theEvent):
"""Custom implementation of the label painter that rotates the
label 90 degrees.
"""
pObj = QStylePainter(self)
oObj = QStyleOptionTab()
+4 -2
View File
@@ -69,11 +69,15 @@ class QConfigLayout(QGridLayout):
return
def setHelpText(self, intRow, theText):
"""Set the text for the help label.
"""
if intRow in self._itemMap:
self._itemMap[intRow]["help"].setText(theText)
return
def setLabelText(self, intRow, theText):
"""Set the text for the main label.
"""
if intRow in self._itemMap:
self._itemMap[intRow]["label"].setText(theText)
return
@@ -85,7 +89,6 @@ class QConfigLayout(QGridLayout):
def addGroupLabel(self, theLabel):
"""Adds a text label to separate groups of settings.
"""
if isinstance(theLabel, QLabel):
qLabel = theLabel
elif isinstance(theLabel, str):
@@ -107,7 +110,6 @@ class QConfigLayout(QGridLayout):
def addRow(self, theLabel, theWidget, helpText=None, theUnit=None):
"""Add a label and a widget as a new row of the grid.
"""
thisEntry = {
"label" : None,
"help" : None,
-1
View File
@@ -97,7 +97,6 @@ class QSwitch(QAbstractButton):
def paintEvent(self, event):
"""Drawing the switch itself.
"""
qPaint = QPainter(self)
qPaint.setRenderHint(QPainter.Antialiasing, True)
qPaint.setPen(Qt.NoPen)