diff options
author | Friedemann Kleint <[email protected]> | 2023-11-28 12:10:26 +0100 |
---|---|---|
committer | Friedemann Kleint <[email protected]> | 2023-11-28 15:58:37 +0100 |
commit | ddc01a90175e90a7854be0d90bed25a902613e59 (patch) | |
tree | 26eecdea75c0f304a46880eec30720822439a34d /examples/widgets/animation | |
parent | ca3a64c024ae817ca38b1df87123f341637c8bd4 (diff) |
Examples: Fix some flake warnings
Mostly spacing related.
Pick-to: 6.6
Change-Id: If0d5b25e1c60b7b216f970d1e57613f00bd04a37
Reviewed-by: Adrian Herrmann <[email protected]>
Diffstat (limited to 'examples/widgets/animation')
-rw-r--r-- | examples/widgets/animation/animatedtiles/animatedtiles.py | 4 | ||||
-rw-r--r-- | examples/widgets/animation/easing/easing.py | 11 |
2 files changed, 7 insertions, 8 deletions
diff --git a/examples/widgets/animation/animatedtiles/animatedtiles.py b/examples/widgets/animation/animatedtiles/animatedtiles.py index b621ec117..fe524361d 100644 --- a/examples/widgets/animation/animatedtiles/animatedtiles.py +++ b/examples/widgets/animation/animatedtiles/animatedtiles.py @@ -95,7 +95,7 @@ class Button(QGraphicsWidget): painter.drawEllipse(r.adjusted(5, 5, -5, -5)) painter.drawPixmap(-self._pix.width() / 2, -self._pix.height() / 2, - self._pix) + self._pix) def mousePressEvent(self, ev): self.pressed.emit() @@ -172,7 +172,7 @@ if __name__ == '__main__': # Random. random_state.assignProperty(item, 'pos', QPointF(-250 + generator.bounded(0, 500), - -250 + generator.bounded(0, 500))) + -250 + generator.bounded(0, 500))) # Tiled. tiled_state.assignProperty(item, 'pos', diff --git a/examples/widgets/animation/easing/easing.py b/examples/widgets/animation/easing/easing.py index f8cba0060..c8a87e8c5 100644 --- a/examples/widgets/animation/easing/easing.py +++ b/examples/widgets/animation/easing/easing.py @@ -125,7 +125,6 @@ class Window(QWidget): curve_types = [(f"QEasingCurve.{e.name}", e) for e in QEasingCurve.Type if e.value <= 40] - with QPainter(pix) as painter: for curve_name, curve_type in curve_types: @@ -151,7 +150,7 @@ class Window(QWidget): # End point. painter.setBrush(Qt.blue) end = QPoint(y_axis + curve_scale, - x_axis - curve_scale * curve.valueForProgress(1)) + x_axis - curve_scale * curve.valueForProgress(1)) painter.drawRect(end.x() - 1, end.y() - 1, 3, 3) curve_path = QPainterPath() @@ -159,7 +158,7 @@ class Window(QWidget): t = 0.0 while t <= 1.0: to = QPointF(y_axis + curve_scale * t, - x_axis - curve_scale * curve.valueForProgress(t)) + x_axis - curve_scale * curve.valueForProgress(t)) curve_path.lineTo(to) t += 1.0 / curve_scale @@ -185,14 +184,14 @@ class Window(QWidget): self._anim.setCurrentTime(0) is_elastic = (curve_type.value >= QEasingCurve.InElastic.value - and curve_type.value <= QEasingCurve.OutInElastic.value) + and curve_type.value <= QEasingCurve.OutInElastic.value) is_bounce = (curve_type.value >= QEasingCurve.InBounce.value - and curve_type.value <= QEasingCurve.OutInBounce.value) + and curve_type.value <= QEasingCurve.OutInBounce.value) self._ui.periodSpinBox.setEnabled(is_elastic) self._ui.amplitudeSpinBox.setEnabled(is_elastic or is_bounce) self._ui.overshootSpinBox.setEnabled(curve_type.value >= QEasingCurve.InBack.value - and curve_type.value <= QEasingCurve.OutInBack.value) + and curve_type.value <= QEasingCurve.OutInBack.value) def path_changed(self, index): self._anim.set_path_type(index) |