diff options
| author | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2020-05-23 14:10:31 +0200 |
|---|---|---|
| committer | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2020-05-25 18:37:51 +0200 |
| commit | b8427aa18824e89a3b28b6b821da4efe0827951b (patch) | |
| tree | a440c1cab4e85c8c9ed95e38969e21707fc97087 /sources/pyside2/doc/codesnippets/examples/widgets | |
| parent | 89f5b036809e8c92d1ce5845417b644064953507 (diff) | |
Rename and update some snippets
* Renaming a few .cpp files into .py
* Replacing the use of SIGNAL() and SLOT()
* Fixing Python syntax
* Removing C++-isms from translated Python code
* Including the snippets from QStackedLayout
Task-number: PYSIDE-691
Fixes: PYSIDE-1309
Change-Id: I431be3d930b2adc36a22118901baa6799581adb2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside2/doc/codesnippets/examples/widgets')
| -rw-r--r-- | sources/pyside2/doc/codesnippets/examples/widgets/spinboxes/window.py (renamed from sources/pyside2/doc/codesnippets/examples/widgets/spinboxes/window.cpp) | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sources/pyside2/doc/codesnippets/examples/widgets/spinboxes/window.cpp b/sources/pyside2/doc/codesnippets/examples/widgets/spinboxes/window.py index 7eace108a..40fe28bf1 100644 --- a/sources/pyside2/doc/codesnippets/examples/widgets/spinboxes/window.cpp +++ b/sources/pyside2/doc/codesnippets/examples/widgets/spinboxes/window.py @@ -147,8 +147,7 @@ def createDateTimeEdits(self): formatComboBox.addItem("hh:mm ap") //! [9] //! [10] - connect(formatComboBox, SIGNAL("activated(const QString &)"), - self, SLOT("setFormatString(const QString &)")) + formatComboBox.activated[str].connect(setFormatString) //! [10] setFormatString(formatComboBox.currentText()) @@ -174,12 +173,12 @@ def setFormatString(self, formatString): meetingEdit.setDateRange(QDate(2004, 11, 1), QDate(2005, 11, 30)) meetingLabel.setText(tr("Meeting date (between %0 and %1):") .arg(meetingEdit.minimumDate().toString(Qt.ISODate)) - .arg(meetingEdit.maximumDate().toString(Qt.ISODate))) + .arg(meetingEdit.maximumDate().toString(Qt.ISODate))) else: meetingEdit.setTimeRange(QTime(0, 7, 20, 0), QTime(21, 0, 0, 0)) meetingLabel.setText(tr("Meeting time (between %0 and %1):") .arg(meetingEdit.minimumTime().toString(Qt.ISODate)) - .arg(meetingEdit.maximumTime().toString(Qt.ISODate))) + .arg(meetingEdit.maximumTime().toString(Qt.ISODate))) //! [13] //! [14] @@ -222,9 +221,8 @@ def createDoubleSpinBoxes(): priceSpinBox.setPrefix("$") priceSpinBox.setValue(99.99) - connect(precisionSpinBox, SIGNAL("valueChanged(int)"), + precisionSpinBox.valueChanged[int].connect(changePrecision) //! [17] - self, SLOT("changePrecision(int))") //! [18] spinBoxLayout = QVBoxLayout() |
