本文整理汇总了Python中PyQt4.QtCore.QPropertyAnimation类的典型用法代码示例。如果您正苦于以下问题:Python QPropertyAnimation类的具体用法?Python QPropertyAnimation怎么用?Python QPropertyAnimation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QPropertyAnimation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _default__geo_animator
def _default__geo_animator(self):
""" Create the default property animator for the rubber band.
"""
p = QPropertyAnimation(self._band, 'geometry')
p.setDuration(self.band_geo_duration)
return p
示例2: setEndValue
def setEndValue(self, endValue):
"""wrapper with debugging code"""
tile = self.targetObject()
if tile.element in Debug.animation:
pName = self.pName()
logDebug('%s: change endValue for %s: %s->%s %s' % (self.ident(), pName, self.formatValue(self.endValue()),
self.formatValue(endValue), str(tile)))
QPropertyAnimation.setEndValue(self, endValue)
示例3: _default__vis_animator
def _default__vis_animator(self):
""" Create the default property animator for the rubber band.
"""
p = QPropertyAnimation(self._band, 'windowOpacity')
p.setDuration(self.band_vis_duration)
p.finished.connect(self._on_vis_finished)
return p
示例4: createAnimationFromToFor
def createAnimationFromToFor(widget, fromValue, toValue, duration, propName, curve=QEasingCurve.InOutCubic):
anim = QPropertyAnimation(widget, propName)
anim.setDuration(duration)
anim.setStartValue(fromValue)
anim.setEndValue(toValue)
anim.setEasingCurve(curve)
return anim
示例5: __init__
def __init__(self, parent = None, connect_cb = None):
QWidget.__init__(self, parent)
self.widgets = connection_properties.Ui_connection_widget()
w = self.widgets
w.setupUi(self)
self.container_height_exclusive = self.sizeHint().height() - self.widgets.proxy_params.sizeHint().height()
self.combined_height = self.sizeHint().height()
if HAS_QPROPERTY_ANIMATION:
self.pp_show_animation = QPropertyAnimation(self, "size", self)
self.pp_show_animation.setDuration(100)
self.pp_show_animation.setStartValue(QSize(self.width(), self.container_height_exclusive))
self.pp_show_animation.setEndValue(QSize(self.width(), self.combined_height))
self.pp_hide_animation = QPropertyAnimation(self, "size", self)
self.pp_hide_animation.setDuration(100)
self.pp_hide_animation.setStartValue(QSize(self.width(), self.combined_height))
self.pp_hide_animation.setEndValue(QSize(self.width(), self.container_height_exclusive))
mkProtocolComboBox(w.w_improto)
w.proxy_params.proxy_type_group = QButtonGroup(w.proxy_params)
for i in ("http", "socks4", "socks5"):
w.proxy_params.proxy_type_group.addButton(getattr(w, "proxy_type_" + i))
self.connect_cb = connect_cb
if connect_cb:
signal_connect(w.w_connect, SIGNAL("clicked()"), self.submit)
signal_connect(w.w_username, SIGNAL("returnPressed()"), self.submit)
signal_connect(w.w_password, SIGNAL("returnPressed()"), self.submit)
if HAS_QPROPERTY_ANIMATION:
@QtCore.pyqtSlot("bool", name="setVisible")
def proxy_setVisible(b):
if b:
self.pp_show_animation.start()
QTimer.singleShot(self.pp_show_animation.duration(),
lambda: type(w.proxy_params).setVisible(w.proxy_params, True))
else:
self.pp_hide_animation.start()
type(w.proxy_params).setVisible(w.proxy_params, False)
w.proxy_params.setVisible = proxy_setVisible
def _hideEvent(e):
if self.parent() and self.parent().layout():
self.parent().layout().activate()
type(w.proxy_params).hideEvent(w.proxy_params, e)
w.proxy_params.hideEvent = _hideEvent
w.proxy_params.setVisible(False)
signal_connect(w.show_proxy_prefs, SIGNAL("toggled(bool)"), w.proxy_params.setVisible)
self.setAutoFillBackground(True)
w.proxy_params.setAutoFillBackground(False)
示例6: __init__
def __init__(self, target, propName, endValue, parent=None):
QPropertyAnimation.__init__(self, target, propName, parent)
QPropertyAnimation.setEndValue(self, endValue)
duration = Preferences.animationDuration()
self.setDuration(duration)
self.setEasingCurve(QEasingCurve.InOutQuad)
target.queuedAnimations.append(self)
Animation.nextAnimations.append(self)
if target.element in Debug.animation:
oldAnimation = target.activeAnimation.get(propName, None)
if isAlive(oldAnimation):
logDebug('new animation %s (after %s is done)' % (self, oldAnimation.ident()))
else:
logDebug('new animation %s' % self)
示例7: __init__
def __init__(self,parent=None):
super(test,self).__init__(parent)
self.pushbutton = MyButton('Popup Button')
# self.pushbutton.setAutoFillBackground(False)
self.pushbutton.move(0, 50)
# self._alpha = 255
# self.pushbutton.setStyle('plastique')
# self.animation = QPropertyAnimation(self.pushbutton, "geometry")
# self.animation.setDuration(1000)
# self.animation.setKeyValueAt(0, QRect(100, 100, 50, 30));
# self.animation.setKeyValueAt(0.8, QRect(150, 150, 50, 30));
# self.animation.setKeyValueAt(1, QRect(100, 100, 50, 30));
self.animation = QPropertyAnimation(self.pushbutton, "alpha")
self.animation.setDuration(1000)
# self.animation.setStartValue(20)
# self.animation.setEndValue(255)
self.animation.setKeyValueAt(0, 10)
self.animation.setKeyValueAt(0.5, 200)
self.animation.setKeyValueAt(1, 255)
self.animation.setLoopCount(5)
self.animation.start()
# print(self.pushbutton)
layout = QVBoxLayout()
layout.addWidget(self.pushbutton)
# layout.addLayout(btnlayout2)
# layout.addLayout(bottomlayout2)
self.setLayout(layout)
self.setGeometry(100, 100, 200, 200)
示例8: __init__
def __init__(self, editor):
super(MiniMap, self).__init__(editor)
self._editor = editor
self.SendScintilla(QsciScintilla.SCI_SETCARETSTYLE, 0)
self.SendScintilla(QsciScintilla.SCI_SETBUFFEREDDRAW, 0)
self.SendScintilla(QsciScintilla.SCI_SETHSCROLLBAR, 0)
self.SendScintilla(QsciScintilla.SCI_SETVSCROLLBAR, 0)
self.SendScintilla(QsciScintilla.SCI_SETZOOM, -10)
self.SendScintilla(QsciScintilla.SCI_SETREADONLY, 1)
self.SendScintilla(QsciScintilla.SCI_HIDESELECTION, 1)
self.SendScintilla(QsciScintilla.SCI_SETCURSOR, 8)
# Hide markers
for i in range(1, 5):
self.SendScintilla(
QsciScintilla.SCI_MARKERDEFINE, i, QsciScintilla.SC_MARK_EMPTY)
self.SendScintilla(QsciScintilla.SCI_SETMARGINWIDTHN, 1, 0)
self.setMouseTracking(True)
if ACTIVATE_OPACITY:
self.goe = QGraphicsOpacityEffect()
self.setGraphicsEffect(self.goe)
self.goe.setOpacity(settings.MINIMAP_MIN_OPACITY)
self.animation = QPropertyAnimation(self.goe, "opacity")
self.animation.setDuration(300)
self.slider = SliderArea(self)
self.slider.show()
示例9: __init__
def __init__(self, parent=None):
super(FileSelector, self).__init__(parent,
Qt.Dialog | Qt.FramelessWindowHint)
self.setObjectName("file-selector")
self._files = {}
self.effect = QGraphicsOpacityEffect()
self.setGraphicsEffect(self.effect)
self.animation = QPropertyAnimation(self.effect, "opacity")
self.animation.setDuration(1500)
box = QVBoxLayout(self)
box.setSpacing(30)
self.list_of_files = QListWidget()
self.list_of_files.setObjectName("list-selector")
box.addWidget(self.list_of_files)
self.label_path = QLabel()
box.addWidget(self.label_path)
self._load_files()
self.connect(self.list_of_files,
SIGNAL("itemSelectionChanged()"),
self._update_label)
self.connect(self.list_of_files,
SIGNAL("itemActivated(QListWidgetItem*)"),
self._open_file)
self.connect(self.list_of_files,
SIGNAL("itemEntered(QListWidgetItem*)"),
self._open_file)
示例10: __init__
def __init__(self, parent):
super(HtmlViewerWidget, self).__init__(parent)
self.setLayout(QGridLayout())
self.layout().setContentsMargins(0, 0, 0, 0)
self.view = QWebView()
self.view.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
self.frame = QFrame()
self.frame.setLayout(QGridLayout())
self.frame.layout().setContentsMargins(0, 0, 0, 0)
self.toolbar = QToolBar()
self.spacer = QWidget()
self.spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self.copyAction = self.toolbar.addAction(QIcon(":/icons/clipboard"), "Copy Text")
self.label = QLabel()
self.closeAction = self.toolbar.addAction(QIcon(":/icons/cancel"), "Close")
self.spaceraction = self.toolbar.insertWidget(self.closeAction, self.spacer)
self.labelaction = self.toolbar.insertWidget(self.spaceraction, self.label)
self.closeAction.triggered.connect(self.close)
self.copyAction.triggered.connect(self.copy_text)
self.layout().addWidget(self.frame)
self.frame.layout().addWidget(self.toolbar)
self.frame.layout().addWidget(self.view)
self.effect = QGraphicsOpacityEffect()
self.label.setGraphicsEffect(self.effect)
self.anim = QPropertyAnimation(self.effect, "opacity")
self.anim.setDuration(2000)
self.anim.setStartValue(1.0)
self.anim.setEndValue(0.0)
self.anim.setEasingCurve(QEasingCurve.OutQuad )
示例11: __init__
def __init__(self, parent=None, animationEnabled=True):
QFrame.__init__(self, parent)
self.__animationEnabled = animationEnabled
layout = StackLayout()
self.__fadeWidget = CrossFadePixmapWidget(self)
self.transitionAnimation = \
QPropertyAnimation(self.__fadeWidget, "blendingFactor_", self)
self.transitionAnimation.setStartValue(0.0)
self.transitionAnimation.setEndValue(1.0)
self.transitionAnimation.setDuration(100 if animationEnabled else 0)
self.transitionAnimation.finished.connect(
self.__onTransitionFinished
)
layout.addWidget(self.__fadeWidget)
layout.currentChanged.connect(self.__onLayoutCurrentChanged)
self.setLayout(layout)
self.__widgets = []
self.__currentIndex = -1
self.__nextCurrentIndex = -1
示例12: __init__
def __init__(self, parent):
super(MiniMap, self).__init__(parent)
self.setWordWrapMode(QTextOption.NoWrap)
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.setReadOnly(True)
self.setCenterOnScroll(True)
self.setMouseTracking(True)
self.viewport().setCursor(Qt.PointingHandCursor)
self.setTextInteractionFlags(Qt.NoTextInteraction)
self._parent = parent
self.highlighter = None
self.lines_count = 0
self.connect(self._parent, SIGNAL("updateRequest(const QRect&, int)"), self.update_visible_area)
if ACTIVATE_OPACITY:
self.goe = QGraphicsOpacityEffect()
self.setGraphicsEffect(self.goe)
self.goe.setOpacity(settings.MINIMAP_MIN_OPACITY)
self.animation = QPropertyAnimation(self.goe, "opacity")
self.slider = SliderArea(self)
self.slider.show()
示例13: move
def move(self, pos):
''' A simple animation to move the letter '''
self.animation = QPropertyAnimation(self, 'pos')
self.animation.setDuration(100)
self.animation.setStartValue(self.scenePos())
self.animation.setEndValue(pos)
self.animation.start()
示例14: setVisible
def setVisible(self, b):
if not b:
self._animation = QPropertyAnimation(self, "size", self)
self._animation.setEndValue(QSize(self.width(), 0))
signal_connect(self._animation, SIGNAL("finished()"), lambda: super(type(self), self).setVisible(False))
self._animation.start()
else:
super(type(self), self).setVisible(b)
示例15: __init__
def __init__(self, parent=None):
""" Inizializza il componente"""
QStackedWidget.__init__(self, parent)
self.__m_vertical=False
self.__m_speed=500
self.__m_animationtype = QEasingCurve.OutQuint #QEasingCurve.OutBack
self.__m_now=0
self.__m_next=0
self.__m_pnow=QPoint(0,0)
self.__m_active = False
self.__direction = self.__SLIDE_TYPE.RIGHT2LEFT
self.__animgroup = QtCore.QParallelAnimationGroup()
self.__animgroup.finished.connect(self.__animationDone)
self.__animnext = QPropertyAnimation(None, "pos")
self.__animnow = QPropertyAnimation(None, "pos")
#self.setMinimumSize(300, 300)
self.setStyleSheet("background-color: rgb(184, 184, 184);")