self.verticalLayout.addWidget(self.nameLabel) self.versionLabel = QLabel(self) self.versionLabel.setText(tr("Version {}").format(QCoreApplication.instance().applicationVersion())) self.verticalLayout.addWidget(self.versionLabel) self.label_3 = QLabel(self) self.verticalLayout.addWidget(self.label_3) self.label_3.setText(tr("Licensed under GPLv3")) self.label = QLabel(self) font = QFont() font.setWeight(75) font.setBold(True) self.label.setFont(font) self.verticalLayout.addWidget(self.label) self.buttonBox = QDialogButtonBox(self) self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Ok) self.verticalLayout.addWidget(self.buttonBox) self.horizontalLayout.addLayout(self.verticalLayout) if __name__ == '__main__': import sys app = QApplication([]) QCoreApplication.setOrganizationName('Hardcoded Software') QCoreApplication.setApplicationName('FooApp') QCoreApplication.setApplicationVersion('1.2.3') app.LOGO_NAME = '' dialog = AboutBox(None, app) dialog.show() sys.exit(app.exec_())
tr("Version {}").format( QCoreApplication.instance().applicationVersion())) self.verticalLayout.addWidget(self.versionLabel) self.label_3 = QLabel(self) self.verticalLayout.addWidget(self.label_3) self.label_3.setText(tr("Licensed under GPLv3")) self.label = QLabel(self) font = QFont() font.setWeight(75) font.setBold(True) self.label.setFont(font) self.verticalLayout.addWidget(self.label) self.buttonBox = QDialogButtonBox(self) self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Ok) self.verticalLayout.addWidget(self.buttonBox) self.horizontalLayout.addLayout(self.verticalLayout) if __name__ == "__main__": import sys app = QApplication([]) QCoreApplication.setOrganizationName("Hardcoded Software") QCoreApplication.setApplicationName("FooApp") QCoreApplication.setApplicationVersion("1.2.3") app.LOGO_NAME = "" dialog = AboutBox(None, app) dialog.show() sys.exit(app.exec_())
self.versionLabel.setText( tr("Version {}").format( QCoreApplication.instance().applicationVersion())) self.verticalLayout.addWidget(self.versionLabel) self.label_3 = QLabel(self) self.verticalLayout.addWidget(self.label_3) self.label_3.setText(tr("Licensed under GPLv3")) self.label = QLabel(self) font = QFont() font.setWeight(75) font.setBold(True) self.label.setFont(font) self.verticalLayout.addWidget(self.label) self.buttonBox = QDialogButtonBox(self) self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Ok) self.verticalLayout.addWidget(self.buttonBox) self.horizontalLayout.addLayout(self.verticalLayout) if __name__ == '__main__': import sys app = QApplication([]) QCoreApplication.setOrganizationName('Hardcoded Software') QCoreApplication.setApplicationName('FooApp') QCoreApplication.setApplicationVersion('1.2.3') app.LOGO_NAME = '' dialog = AboutBox(None, app) dialog.show() sys.exit(app.exec_())