Questions tagged [qpropertyanimation]

The QPropertyAnimation class animates Qt properties.

The QPropertyAnimation class animates Qt properties.

QPropertyAnimation interpolates over Qt properties. As property values are stored in QVariants, the class inherits QVariantAnimation, and supports animation of the same variant types as its super class.

A class declaring properties must be a QObject. To make it possible to animate a property, it must provide a setter (so that QPropertyAnimation can set the property's value). Note that this makes it possible to animate many of Qt's widgets.

Reference: https://doc.qt.io/qt-5/qpropertyanimation.html

60 questions
4
votes
1 answer

Qt resize layout during widget property animation

I have an existing application that I am polishing off and I want to add some animation to a few of the widgets. Animating widgets with QPropertyAnimation outside of layouts is easy and fun, however when they are in a layout I am having various…
Spencer
  • 1,931
  • 1
  • 21
  • 44
4
votes
1 answer

PyQt5 styleSheet Animation

I am using PyQt5 to build an app with multiple buttons. What I am trying to accomplish is to create a blinking background color (yellow-red) for some of my buttons. btn1.setStyleSheet("background-color: green; color: red; font-weight: 800;…
Eilat
  • 73
  • 1
  • 1
  • 5
3
votes
1 answer

The QPropertyAnimation is automatically deleted when using QParallelAnimationGroup?

Based on the following code snippet, I have a doubt related to QPropertyAnimation and QParallelAnimationGroup: // Create the opacity animation QPropertyAnimation *animation1 = new QPropertyAnimation(notification,…
KelvinS
  • 2,870
  • 8
  • 34
  • 67
3
votes
2 answers

Custom Property animation not working on disabling animation

I am creating an android application where each fragment is bind to a custom left to right slide animation. That i achieved using Custom Property Animation(FractionLinearLayout.java class given below). My app has several Fragment, switching among…
3
votes
0 answers

Animation when adding items to qgraphicsLayout

In QgraphicsWidget im adding new items (QGraphicsLayoutItem) using Drag/drop on the QGraphicsWidget and using QGraphicsLinearLayout. If the user wants to move or create the item between the items already present in the layout , i have to animate the…
Wagmare
  • 1,354
  • 1
  • 24
  • 58
3
votes
2 answers

How to animate color of QBrush

I want to animate Color of QBrush. For more details see code below That's my .h file class Cell : public QObject, public QGraphicsRectItem { Q_OBJECT Q_PROPERTY(QBrush brush READ brush WRITE set_Brush) public: QBrush _brush() const; …
OneOne
  • 131
  • 9
2
votes
1 answer

Qt - Create Button with images which fade out & fade in in parallel on hoverEvent

In C++/Qt6, I would like to develop a button with an animation (I imagine that I'll have to use QParallelAnimationGroup) which fade out an image in parallel of a fade in another image as the icon of the button. Here is what I want (made with a movie…
2
votes
1 answer

Animating FontSize of a QLabel in PyQt5

I wanted to ask if we could just animate the fontsize of the QLabel in PyQt5 with QPropertyAnimation. I tried by adding QPropertyAnimation(self.label , b"fontSize") but It was not working and I got the warning I want you increase the text of the…
TheFishTheySay
  • 190
  • 2
  • 17
2
votes
1 answer

How to use QPropertyAnimation with QPainter to draw an arc

I'm writing a desktop widget that performs the function of a system monitor. Using a QPainter I draw an arc which represents a graphical representation of a cpu usage level. Every second a paintevent redraw this arc with a span angle based on a…
Artem
  • 563
  • 3
  • 17
2
votes
1 answer

Change QPropertyAnimation duration on the fly

I'm using this solution to animate ellipses along a QPainterPath. But I need to slowly increase or decrease the speed of the animation. I create a timer and set a new duration for the animation but the result is a choppy animation because the…
user2246120
  • 1,453
  • 2
  • 17
  • 38
2
votes
0 answers

How to avoid periodic flicker/drag effect during slideshow with QPropertyAnimation

QPropertyAnimation produces periodic flicker/drag effect during animation of longer duration of about 1 second or two. For small duration animation (about 500 ms or less) the QPropertyAnimation produces smooth animation without that specific…
Shuji
  • 624
  • 1
  • 8
  • 24
2
votes
1 answer

How to make fix size of QDialog after using animation of resizing Dialog?

I'm using QtAnimation using setStartValue(Rect) and setEndValue(Rect) I want to make it of fixed size after animation. How to proceed?
1
vote
1 answer

PyQt5: prevent QPropertyAnimation jumping to different animation after another animation is set

I am running into a problem with the QPropertyAnimation class where if I call the animate method more then once, it skips all of the calls to self.animate and executes the last animation instead of all of them. I have tried to clear all the Key…
Nah
  • 189
  • 1
  • 11
1
vote
1 answer

pyqt6 animation doesnt work for decreasing width

I have struggle with animation. It works first time to increase width but with else statements it doesnt' decrease size. def slideLeftMenu(self): self.animation=QPropertyAnimation(self.ui.LeftMenuContainer,b'minimumWidth') …
cryg0
  • 55
  • 1
  • 6
1
vote
1 answer

When two widget animation commands run at start only one gets animated

I am trying hide two list widgets upon start by animating the maximum width to zero, then two buttons to toggle each widget to appear and disappear, this works fine, but not at start, only one of the two widget gets animated, the other just stays…
Jack Zero
  • 77
  • 6
1
2 3 4