I'm practicing my programming skills and I am trying to build a login-system application with PyQt
. I designed it after Login V4 . Now I'm trying to achieve that cool gradient animation from the Login button when you hover over it. But the CSS
code to animate something like that doesn't work in qt stylesheet
. I designed the app with the Qt Designer. Is it even possible to create that animation in pyqt
? If yes, how do you that?
My app looks like this:
The stylesheet code of the Login button:
QPushButton#login_button {
font: 75 10pt "Microsoft YaHei UI";
font-weight: bold;
color: rgb(255, 255, 255);
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgb(61, 217, 245), stop:1 rgb(240, 53, 218));
border-style: solid;
border-radius:21px;
}
start=cyan, stop=magenta
, then at 10%start=0.9*cyan+0.1*magenta, stop=0.9*magenta+0.1*cyan
etc. and you update the stylesheet in a rapid succession. Of course replace cyan and magenta with their rgb equivalent. – Synthetic