From 379c8bde46e68c71f164a39127332d267e65f63d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 19 May 2015 08:59:50 +0530 Subject: [PATCH] Fix DeprecationWarning for QPropertyAnimation --- src/calibre/gui2/bars.py | 2 +- src/calibre/gui2/book_details.py | 2 +- src/calibre/gui2/job_indicator.py | 4 ++-- src/calibre/gui2/library/alternate_views.py | 2 +- src/calibre/gui2/proceed.py | 4 ++-- src/calibre/gui2/throbber.py | 2 +- src/calibre/gui2/viewer/flip.py | 2 +- src/calibre/gui2/viewer/main.py | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/calibre/gui2/bars.py b/src/calibre/gui2/bars.py index 74a36ca3b5..48d3d890cb 100644 --- a/src/calibre/gui2/bars.py +++ b/src/calibre/gui2/bars.py @@ -22,7 +22,7 @@ class RevealBar(QWidget): # {{{ QWidget.__init__(self, parent) self.setVisible(False) self._animated_size = 1.0 - self.animation = QPropertyAnimation(self, 'animated_size', self) + self.animation = QPropertyAnimation(self, b'animated_size', self) self.animation.setEasingCurve(QEasingCurve.Linear) self.animation.setDuration(1000), self.animation.setStartValue(0.0), self.animation.setEndValue(1.0) self.animation.valueChanged.connect(self.animation_value_changed) diff --git a/src/calibre/gui2/book_details.py b/src/calibre/gui2/book_details.py index 96cce15b9e..86b754eab7 100644 --- a/src/calibre/gui2/book_details.py +++ b/src/calibre/gui2/book_details.py @@ -207,7 +207,7 @@ class CoverView(QWidget): # {{{ self._current_pixmap_size = QSize(120, 120) self.vertical = vertical - self.animation = QPropertyAnimation(self, 'current_pixmap_size', self) + self.animation = QPropertyAnimation(self, b'current_pixmap_size', self) self.animation.setEasingCurve(QEasingCurve(QEasingCurve.OutExpo)) self.animation.setDuration(1000) self.animation.setStartValue(QSize(0, 0)) diff --git a/src/calibre/gui2/job_indicator.py b/src/calibre/gui2/job_indicator.py index 13dbf962ec..fab90baaf6 100644 --- a/src/calibre/gui2/job_indicator.py +++ b/src/calibre/gui2/job_indicator.py @@ -20,7 +20,7 @@ class Pointer(QWidget): self.setObjectName('jobs_pointer') self.setVisible(False) self.resize(100, 80) - self.animation = QPropertyAnimation(self, "geometry", self) + self.animation = QPropertyAnimation(self, b"geometry", self) self.animation.setDuration(750) self.animation.setLoopCount(2) self.animation.setEasingCurve(QEasingCurve.Linear) @@ -69,7 +69,7 @@ class Pointer(QWidget): self.setVisible(True) self.raise_() end = self.abspos(self.gui.jobs_button) - end = QPointF( end.x() + self.gui.jobs_button.width()/3.0, end.y()+20) + end = QPointF(end.x() + self.gui.jobs_button.width()/3.0, end.y()+20) start = QPointF(end.x(), end.y() - 0.5*self.height()) self.path = QPainterPath(QPointF(start)) self.path.lineTo(end) diff --git a/src/calibre/gui2/library/alternate_views.py b/src/calibre/gui2/library/alternate_views.py index c39eb23b37..f49234367f 100644 --- a/src/calibre/gui2/library/alternate_views.py +++ b/src/calibre/gui2/library/alternate_views.py @@ -325,7 +325,7 @@ class CoverDelegate(QStyledItemDelegate): def __init__(self, parent): super(CoverDelegate, self).__init__(parent) self._animated_size = 1.0 - self.animation = QPropertyAnimation(self, 'animated_size', self) + self.animation = QPropertyAnimation(self, b'animated_size', self) self.animation.setEasingCurve(QEasingCurve.OutInCirc) self.animation.setDuration(500) self.set_dimensions() diff --git a/src/calibre/gui2/proceed.py b/src/calibre/gui2/proceed.py index f7e2064cf4..84634d3284 100644 --- a/src/calibre/gui2/proceed.py +++ b/src/calibre/gui2/proceed.py @@ -47,7 +47,7 @@ class Icon(QWidget): self.set_icon('dialog_question.png') self.default_icon = self.icon self._fraction = 0.0 - self.animation = a = QPropertyAnimation(self, "fraction", self) + self.animation = a = QPropertyAnimation(self, b"fraction", self) a.setDuration(2000), a.setEasingCurve(QEasingCurve.Linear) a.setStartValue(0.0), a.setEndValue(2.0), a.setLoopCount(10) @@ -96,7 +96,7 @@ class ProceedQuestion(QWidget): parent.installEventFilter(self) self._show_fraction = 0.0 - self.show_animation = a = QPropertyAnimation(self, "show_fraction", self) + self.show_animation = a = QPropertyAnimation(self, b"show_fraction", self) a.setDuration(1000), a.setEasingCurve(QEasingCurve.OutQuad) a.setStartValue(0.0), a.setEndValue(1.0) a.finished.connect(self.stop_show_animation) diff --git a/src/calibre/gui2/throbber.py b/src/calibre/gui2/throbber.py index 6afdfbda3a..d454930e99 100644 --- a/src/calibre/gui2/throbber.py +++ b/src/calibre/gui2/throbber.py @@ -16,7 +16,7 @@ class ThrobbingButton(QToolButton): def __init__(self, *args): QToolButton.__init__(self, *args) - self.animation = QPropertyAnimation(self, 'iconSize', self) + self.animation = QPropertyAnimation(self, b'iconSize', self) self.animation.setDuration(60/72.*1000) self.animation.setLoopCount(4) self.normal_icon_size = QSize(64, 64) diff --git a/src/calibre/gui2/viewer/flip.py b/src/calibre/gui2/viewer/flip.py index c0f90b597e..d434e75f2e 100644 --- a/src/calibre/gui2/viewer/flip.py +++ b/src/calibre/gui2/viewer/flip.py @@ -20,7 +20,7 @@ class SlideFlip(QWidget): self.setGeometry(0, 0, 1, 1) self._current_width = 0 self.before_image = self.after_image = None - self.animation = QPropertyAnimation(self, 'current_width', self) + self.animation = QPropertyAnimation(self, b'current_width', self) self.setVisible(False) self.animation.valueChanged.connect(self.update) self.animation.finished.connect(self.finished) diff --git a/src/calibre/gui2/viewer/main.py b/src/calibre/gui2/viewer/main.py index b0511bb79c..199e337605 100644 --- a/src/calibre/gui2/viewer/main.py +++ b/src/calibre/gui2/viewer/main.py @@ -150,7 +150,7 @@ class EbookViewer(MainWindow): self.toolbar_hidden = None self.addAction(self.toggle_toolbar_action) self.full_screen_label_anim = QPropertyAnimation( - self.full_screen_label, 'size') + self.full_screen_label, b'size') self.clock_timer = QTimer(self) self.clock_timer.timeout.connect(self.update_clock)