5 |
5 |
6 """ |
6 """ |
7 Module implementing a dialog to show the versions of various components. |
7 Module implementing a dialog to show the versions of various components. |
8 """ |
8 """ |
9 |
9 |
|
10 from PyQt6.QtCore import Qt |
10 from PyQt6.QtGui import QGuiApplication |
11 from PyQt6.QtGui import QGuiApplication |
11 from PyQt6.QtWidgets import QDialog, QDialogButtonBox |
12 from PyQt6.QtWidgets import QDialog, QDialogButtonBox |
12 |
13 |
13 from .Ui_VersionsDialog import Ui_VersionsDialog |
14 from .Ui_VersionsDialog import Ui_VersionsDialog |
14 |
15 |
41 self.__upgradePyQtButton = self.buttonBox.addButton( |
42 self.__upgradePyQtButton = self.buttonBox.addButton( |
42 self.tr("Upgrade PyQt..."), QDialogButtonBox.ButtonRole.ActionRole |
43 self.tr("Upgrade PyQt..."), QDialogButtonBox.ButtonRole.ActionRole |
43 ) |
44 ) |
44 self.__upgradePyQtButton.clicked.connect(parent.upgradePyQt) |
45 self.__upgradePyQtButton.clicked.connect(parent.upgradePyQt) |
45 |
46 |
|
47 self.buttonBox.button( |
|
48 QDialogButtonBox.StandardButton.Ok).setDefault(True) |
|
49 self.buttonBox.button( |
|
50 QDialogButtonBox.StandardButton.Ok).setFocus( |
|
51 Qt.FocusReason.OtherFocusReason) |
|
52 |
46 msh = self.minimumSizeHint() |
53 msh = self.minimumSizeHint() |
47 self.resize(max(self.width(), msh.width()), msh.height()) |
54 self.resize(max(self.width(), msh.width()), msh.height()) |
48 |
55 |
49 self.exec() |
56 self.exec() |