Skip to content

Commit

Permalink
FIx example 02
Browse files Browse the repository at this point in the history
Thank you @olli-suoniemi for the PR.
  • Loading branch information
mherrmann authored Jun 23, 2022
2 parents 946320e + 4428fc2 commit a728717
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/02 PyQt Widgets/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self, parent=None):
self.createBottomRightGroupBox()
self.createProgressBar()

styleComboBox.activated[str].connect(self.changeStyle)
styleComboBox.textActivated.connect(self.changeStyle)
self.useStylePaletteCheckBox.toggled.connect(self.changePalette)
disableWidgetsCheckBox.toggled.connect(self.topLeftGroupBox.setDisabled)
disableWidgetsCheckBox.toggled.connect(self.topRightGroupBox.setDisabled)
Expand Down Expand Up @@ -128,15 +128,15 @@ def createTopLeftGroupBox(self):

checkBox = QCheckBox("Tri-state check box")
checkBox.setTristate(True)
checkBox.setCheckState(Qt.PartiallyChecked)
checkBox.setCheckState(Qt.CheckState.PartiallyChecked)

layout = QVBoxLayout()
layout.addWidget(radioButton1)
layout.addWidget(radioButton2)
layout.addWidget(radioButton3)
layout.addWidget(checkBox)
layout.addStretch(1)
self.topLeftGroupBox.setLayout(layout)
self.topLeftGroupBox.setLayout(layout)

def createTopRightGroupBox(self):
self.topRightGroupBox = QGroupBox("Group 2")
Expand All @@ -160,8 +160,8 @@ def createTopRightGroupBox(self):

def createBottomLeftTabWidget(self):
self.bottomLeftTabWidget = QTabWidget()
self.bottomLeftTabWidget.setSizePolicy(QSizePolicy.Preferred,
QSizePolicy.Ignored)
self.bottomLeftTabWidget.setSizePolicy(QSizePolicy.Policy.Preferred,
QSizePolicy.Policy.Ignored)

tab1 = QWidget()
tableWidget = QTableWidget(10, 10)
Expand Down Expand Up @@ -195,18 +195,18 @@ def createBottomRightGroupBox(self):
self.bottomRightGroupBox.setChecked(True)

lineEdit = QLineEdit('s3cRe7')
lineEdit.setEchoMode(QLineEdit.Password)
lineEdit.setEchoMode(QLineEdit.EchoMode.Password)

spinBox = QSpinBox(self.bottomRightGroupBox)
spinBox.setValue(50)

dateTimeEdit = QDateTimeEdit(self.bottomRightGroupBox)
dateTimeEdit.setDateTime(QDateTime.currentDateTime())

slider = QSlider(Qt.Horizontal, self.bottomRightGroupBox)
slider = QSlider(Qt.Orientation.Horizontal, self.bottomRightGroupBox)
slider.setValue(40)

scrollBar = QScrollBar(Qt.Horizontal, self.bottomRightGroupBox)
scrollBar = QScrollBar(Qt.Orientation.Horizontal, self.bottomRightGroupBox)
scrollBar.setValue(60)

dial = QDial(self.bottomRightGroupBox)
Expand Down Expand Up @@ -240,4 +240,4 @@ def createProgressBar(self):
app = QApplication(sys.argv)
gallery = WidgetGallery()
gallery.show()
sys.exit(app.exec())
sys.exit(app.exec())

0 comments on commit a728717

Please sign in to comment.