eric6/E5Gui/E5SimpleHelpDialog.py

Sat, 10 Apr 2021 18:38:27 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 10 Apr 2021 18:38:27 +0200
changeset 8218
7c09585bd960
parent 8143
2c730d5fd177
permissions
-rw-r--r--

Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).

# -*- coding: utf-8 -*-

# Copyright (c) 2015 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing a dialog to show some help text.
"""

from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QDialog

from .Ui_E5SimpleHelpDialog import Ui_E5SimpleHelpDialog


class E5SimpleHelpDialog(QDialog, Ui_E5SimpleHelpDialog):
    """
    Class implementing a dialog to show some help text.
    """
    def __init__(self, title="", label="", helpStr="", parent=None):
        """
        Constructor
        
        @param title title of the window
        @type str
        @param label label for the help
        @type str
        @param helpStr HTML help text
        @type str
        @param parent reference to the parent widget
        @type QWidget
        """
        super().__init__(parent)
        self.setupUi(self)
        self.setWindowFlags(Qt.WindowType.Window)
        
        self.setWindowTitle(title)
        if label:
            self.helpLabel.setText(label)
        else:
            self.helpLabel.hide()
        self.helpEdit.setHtml(helpStr)

eric ide

mercurial