diff -r 52a07d67f4ed -r 188ff9ce8657 eric7/UI/VersionsDialog.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/eric7/UI/VersionsDialog.py Sat Mar 05 18:01:12 2022 +0100 @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2022 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module implementing a dialog to show the versions of various components. +""" + +from PyQt6.QtGui import QGuiApplication +from PyQt6.QtWidgets import QDialog, QDialogButtonBox + +from .Ui_VersionsDialog import Ui_VersionsDialog + + +class VersionsDialog(QDialog, Ui_VersionsDialog): + """ + Class implementing a dialog to show the versions of various components. + """ + def __init__(self, parent, title, text): + """ + Constructor + + @param parent reference to the parent widget + @type UserInterface + @param title dialog title + @type str + @param text versions text to be shown + @type str + """ + super().__init__(parent) + self.setupUi(self) + + self.__ui = parent + icon = QGuiApplication.windowIcon().pixmap(64, 64) + + self.setWindowTitle(title) + self.iconLabel.setPixmap(icon) + self.textLabel.setText(text) + + self.__upgradePyQtButton = self.buttonBox.addButton( + self.tr("Upgrade PyQt..."), QDialogButtonBox.ButtonRole.ActionRole + ) + self.__upgradePyQtButton.clicked.connect(parent.upgradePyQt) + + msh = self.minimumSizeHint() + self.resize(max(self.width(), msh.width()), msh.height()) + + self.exec()