There is a button, on the button 3 images are attached. That is, the button changes its appearance by events. By hovering the cursor, by clicking and by the way the cursor goes beyond the button. And I need the image (that is, the background on the button) to change depending on the event, only smoothly. That is, by pointing the cursor, he smoothly changed his background to another image and also by pressing the button smoothly the image should change to another.
I made the animation with gradients, I thought it would help, however, he swears that I want to push the image into a property (not into a gradient property).
I fix the project itself with images
I honestly try myself, but it does not work. On Qt Widgets I wrote this project a long time ago, but the customer asks for beauty and animation.
Here is the code, it is very simple:
Button { id: btnAnim width: 250 height: 100 anchors.centerIn: parent text: "Anim button " //самое костыльное позиционирование текста style: ButtonStyle { background: Image { fillMode: Image.PreserveAspectFit source: { control.pressed ? "btn_pressed.png" : (control.hovered ? "btn_hovered.png" : "btn_state.png") } } } }