2
0
mirror of https://github.com/pyqt/examples.git synced 2025-08-29 04:47:41 +00:00

FIx example 02

Thank you @olli-suoniemi for the PR.
This commit is contained in:
Michael Herrmann 2022-06-23 13:23:49 +02:00 committed by GitHub
commit a72871707b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,7 +73,7 @@ class WidgetGallery(QDialog):
self.createBottomRightGroupBox() self.createBottomRightGroupBox()
self.createProgressBar() self.createProgressBar()
styleComboBox.activated[str].connect(self.changeStyle) styleComboBox.textActivated.connect(self.changeStyle)
self.useStylePaletteCheckBox.toggled.connect(self.changePalette) self.useStylePaletteCheckBox.toggled.connect(self.changePalette)
disableWidgetsCheckBox.toggled.connect(self.topLeftGroupBox.setDisabled) disableWidgetsCheckBox.toggled.connect(self.topLeftGroupBox.setDisabled)
disableWidgetsCheckBox.toggled.connect(self.topRightGroupBox.setDisabled) disableWidgetsCheckBox.toggled.connect(self.topRightGroupBox.setDisabled)
@ -128,7 +128,7 @@ class WidgetGallery(QDialog):
checkBox = QCheckBox("Tri-state check box") checkBox = QCheckBox("Tri-state check box")
checkBox.setTristate(True) checkBox.setTristate(True)
checkBox.setCheckState(Qt.PartiallyChecked) checkBox.setCheckState(Qt.CheckState.PartiallyChecked)
layout = QVBoxLayout() layout = QVBoxLayout()
layout.addWidget(radioButton1) layout.addWidget(radioButton1)
@ -160,8 +160,8 @@ class WidgetGallery(QDialog):
def createBottomLeftTabWidget(self): def createBottomLeftTabWidget(self):
self.bottomLeftTabWidget = QTabWidget() self.bottomLeftTabWidget = QTabWidget()
self.bottomLeftTabWidget.setSizePolicy(QSizePolicy.Preferred, self.bottomLeftTabWidget.setSizePolicy(QSizePolicy.Policy.Preferred,
QSizePolicy.Ignored) QSizePolicy.Policy.Ignored)
tab1 = QWidget() tab1 = QWidget()
tableWidget = QTableWidget(10, 10) tableWidget = QTableWidget(10, 10)
@ -195,7 +195,7 @@ class WidgetGallery(QDialog):
self.bottomRightGroupBox.setChecked(True) self.bottomRightGroupBox.setChecked(True)
lineEdit = QLineEdit('s3cRe7') lineEdit = QLineEdit('s3cRe7')
lineEdit.setEchoMode(QLineEdit.Password) lineEdit.setEchoMode(QLineEdit.EchoMode.Password)
spinBox = QSpinBox(self.bottomRightGroupBox) spinBox = QSpinBox(self.bottomRightGroupBox)
spinBox.setValue(50) spinBox.setValue(50)
@ -203,10 +203,10 @@ class WidgetGallery(QDialog):
dateTimeEdit = QDateTimeEdit(self.bottomRightGroupBox) dateTimeEdit = QDateTimeEdit(self.bottomRightGroupBox)
dateTimeEdit.setDateTime(QDateTime.currentDateTime()) dateTimeEdit.setDateTime(QDateTime.currentDateTime())
slider = QSlider(Qt.Horizontal, self.bottomRightGroupBox) slider = QSlider(Qt.Orientation.Horizontal, self.bottomRightGroupBox)
slider.setValue(40) slider.setValue(40)
scrollBar = QScrollBar(Qt.Horizontal, self.bottomRightGroupBox) scrollBar = QScrollBar(Qt.Orientation.Horizontal, self.bottomRightGroupBox)
scrollBar.setValue(60) scrollBar.setValue(60)
dial = QDial(self.bottomRightGroupBox) dial = QDial(self.bottomRightGroupBox)