eric6/E5Gui/E5AnimatedWidget.py

Sat, 27 Feb 2021 12:08:23 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 27 Feb 2021 12:08:23 +0100
changeset 8138
169e65a6787c
parent 7923
91e843545d9a
child 8143
2c730d5fd177
permissions
-rw-r--r--

Shell: added functionality to show a prompt when the main client process has exited (e.g. a script ended).

4353
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2015 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
4353
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing an animated widget.
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 #
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 # Code was inspired by qupzilla web browser
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 #
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 from PyQt5.QtCore import pyqtSlot, QTimeLine, QPoint
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 from PyQt5.QtWidgets import QWidget
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 class E5AnimatedWidget(QWidget):
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 """
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 Class implementing an animated widget.
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 """
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 DirectionDown = 0
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 DirectionUp = 1
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 def __init__(self, direction=DirectionDown, duration=300, parent=None):
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 Constructor
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 @param direction direction of the animation
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 @type int (one of DirectionDown or DirectionUp)
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 @param duration duration of the animation
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 @type int
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 @param parent reference to the parent widget
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 @type QWidget
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 """
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 super(E5AnimatedWidget, self).__init__(parent)
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.__direction = direction
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 self.__stepHeight = 0.0
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 self.__stepY = 0.0
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 self.__startY = 0
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 self.__widget = QWidget(self)
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 self.__timeline = QTimeLine(duration)
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 self.__timeline.setFrameRange(0, 100)
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 self.__timeline.frameChanged.connect(self.__animateFrame)
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 self.setMaximumHeight(0)
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 def widget(self):
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 """
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 Public method to get a reference to the animated widget.
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 @return reference to the animated widget
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 @rtype QWidget
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 """
4356
975993ebd7fb Finished implementing the HTML5 feature permission manager and associated dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4354
diff changeset
57 return self.__widget
4353
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 @pyqtSlot()
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 def startAnimation(self):
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 """
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 Public slot to start the animation.
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 """
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 if self.__timeline.state() == QTimeLine.Running:
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 return
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 shown = 0
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 hidden = 0
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 if self.__direction == self.DirectionDown:
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 shown = 0
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 hidden = -self.__widget.height()
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 self.__widget.move(QPoint(self.__widget.pos().x(), hidden))
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 self.__stepY = (hidden - shown) / 100.0
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 self.__startY = hidden
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 self.__stepHeight = self.__widget.height() / 100.0
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 self.__timeline.setDirection(QTimeLine.Forward)
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 self.__timeline.start()
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 @pyqtSlot(int)
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 def __animateFrame(self, frame):
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 """
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 Private slot to animate the next frame.
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 @param frame frame number
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 @type int
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 """
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 self.setFixedHeight(frame * self.__stepHeight)
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 self.__widget.move(self.pos().x(),
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 self.__startY - frame * self.__stepY)
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 @pyqtSlot()
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 def hide(self):
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 """
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 Public slot to hide the animated widget.
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 """
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 if self.__timeline.state() == QTimeLine.Running:
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 return
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 self.__timeline.setDirection(QTimeLine.Backward)
4354
bc2b247a75df Little change to the E5AnimatedWidget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4353
diff changeset
104 self.__timeline.finished.connect(self.close)
4353
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 self.__timeline.start()
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 p = self.parentWidget()
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 if p is not None:
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 p.setFocus()
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 def resizeEvent(self, evt):
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 """
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 Protected method to handle a resize event.
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 @param evt reference to the event object
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 @type QResizeEvent
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 """
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 if evt.size().width() != self.__widget.width():
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 self.__widget.resize(evt.size().width(), self.__widget.height())
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120
cff7e27fb7b8 Added the E5AnimatedWidget class and changed FeaturePermissionBar to use it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 super(E5AnimatedWidget, self).resizeEvent(evt)

eric ide

mercurial