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
1
vote
1 answer

Easiest way to animate QGraphicsPixmapItem?

I want to animate a QGraphicsPixmapItem in my QGraphicsScene, with QPropertyAnimation. QPixmap pixmap(filePath); QGraphicsItem *pixmapItem = graphicsScene->addPixmap(pixmap); QPropertyAnimation animation(pixmapItem, "x"); // here lies the…
Dach Boden
  • 11
  • 4
1
vote
1 answer

use of qpropretyanimation desirably

In this program I have built a QPropertyanimation and add to it my item and pos() property. I override KeyPressEvent. And with using of keys consist of j, f, z item go forward ,go back and jump. According gravity when item jump should fall. For this…
maryam
  • 1,437
  • 2
  • 18
  • 40
0
votes
0 answers

Wrong visual display of QPropertyAnimation

I decided to animate my application in Qt 6.4.0, for this I use QPropertyAnimation and QGraphicsOpacityEffect. But when overlaying, a failure occurs and the elements visually shift. And the buttons themselves remain in place. The effect appears…
Artem
  • 1
0
votes
0 answers

PyQt QPropertyAnimation not starting

I have implemented a custom label that animates the font size. When defining the UI programatically, as in AniLabelTest, the animation works. However, when using the UI designed in QtCreator, the animation does not work. How could it be fixed? from…
aescarve
  • 3
  • 3
0
votes
1 answer

How to detect when QPropertyAnimation finishes?

I have a code: void testbutton::buttonPressEvent(bool pressed_arg){ QPropertyAnimation *animation = new QPropertyAnimation(m_button_bg, "size", this); animation->setDuration(500); animation->setEasingCurve(QEasingCurve::InCurve); int…
why
  • 31
  • 5
0
votes
1 answer

How to create a simple animated button in Qt?

I don't understand the syntax of QPropertyAnimation at all, I looked at several "similar" questions, but I couldn't figure it out. Could you write a simple example of a button that, when pressed, will gradually reduce its width to zero, so that one…
why
  • 31
  • 5
0
votes
1 answer

The pyqt6 animation does not manage to work properly WHY?

I did a toggle menu when I pressed the button it will expand(Increase the height) and shrink(Decrease the height). That is what I expected. It turns out that it fine for expanding the menu but not with shrinking. I set QFrame with minimum: W 201 H…
0
votes
1 answer

Animating QPushButton PyQt

I'm having an issue trying to animate a QPushButtons. I've a queue of buttons that once popped, I would like to animate from one color to another. I've recreated a minimum working example below: from PyQt5 import QtCore, QtGui from PyQt5.QtWidgets…
Aziziz14
  • 35
  • 3
0
votes
0 answers

2048 qt6, animation breaks

I am writing a game 2048, I decided to add an animation at the moment of connecting two numbers. unfortunately, it breaks (pictures are attached) the code is also below, please help. Breaks if you very quickly click on the "AWSD" keys (control…
0
votes
1 answer

How to ignore an event until the other same type event is completed in PyQt

I want you to assume an extremely basic situation where if you hover over a slider, it slightly enlarges and then goes back to its original size when you leave its surface. Here is the code: def enterEvent(self,event): self.anim =…
proz goret
  • 15
  • 5
0
votes
0 answers

How can I make the animation to rotate a widget in PyQt5?

I want to convert the anim_2 into a rotation but I don't know how or even if it's possible. I tried to use the QPropertyAnimation with (b"angle") but it don't do nothing. Any help or idea? Thanks! import sys from PyQt5.QtCore import * from…
0
votes
1 answer

Working with 2D arrays with QPropertyAnimation in PyQt5 Python

When I work with QPropertyAnimation with 1D array, there is no problem. It accepts all the animation orders. However, I want to clearify my code, because I'll work many images. So I tried to use 2D array for images and its' animations. Same logic…
Fatih Tüz
  • 133
  • 1
  • 12
0
votes
0 answers

Using QWebEngineView seems to disrupt QPropertyAnimation smoothness, even if QWebEngineView has just been destroyed

I have a problem with QPropertyAnimation when QWebEngineView is used in the same QMainWindow. If I create 15 QPropertyAnimation (animate QGraphicsRectItem), and in the same time I use a QWebEngineView, then animations become very slow. I have…
0
votes
0 answers

QPropetyAnimation not working as expected in the mosemove event

I'm working on animations. So I'm getting some issue on this. I need to animate the screen with qpropertyanimation. Problem is When the user drag the screen through mousemove event, screen has to drag with respective mouse positions. If Mouse…
0
votes
1 answer

How to animate the background color of a QPushButton(change button color dynamically)

I am trying to make a pushButton in pyqt5 Python, change background color - shades, etc. from a light green, to grenn, and then, to dark green. I have tryied some code, but nothing. Here's my code: def colorChange(self,button): …