Fix DeprecationWarning for QPropertyAnimation

This commit is contained in:
Kovid Goyal 2015-05-19 08:59:50 +05:30
parent c00057b9fc
commit 379c8bde46
8 changed files with 10 additions and 10 deletions

View File

@ -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)

View File

@ -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))

View File

@ -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)

View File

@ -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()

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)