Sat, 05 Mar 2022 18:01:12 +0100
Added capability to upgrade PyQt packages eric depends on from within eric.
# -*- 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()