"Loading" effect with border's pushbutton
-
wrote on 24 Feb 2014, 09:24 last edited by
Hello,
I have a rounded QPushButton with border.
I would like this border to be dual color depending on a value to achieve a loading effect.
For example value 0, all the border is white, nothing is loaded; value 180, the left border is red, the right border is white, half the content has been loaded, 360 (max value) the border is completely red, everything is loaded.Do you have any idea how to achieve that?
Cheers,
-
wrote on 24 Feb 2014, 11:29 last edited by
Have you tried to use pushButton.styleSheet
-
wrote on 24 Feb 2014, 11:35 last edited by
yes of course but it just gives me a border.
Then I need to customize it, I tried with gradient to have 2 colors but it gives strange results when the button is rounded, the gradiant is not calculated correctly :( -
wrote on 25 Feb 2014, 09:29 last edited by
BlackMamba:
I made a few tests with "border-top-color, border-right-width"
etc. but could not find an attractive working solution - especially for rounded borders. I think you should consider to use bitmaps to meet your target. -
wrote on 25 Feb 2014, 14:17 last edited by
Thanks for your help ! How would you start to achieve this with bitmaps?
-
wrote on 25 Feb 2014, 14:36 last edited by
I haven't worked with the .border-image yet, but some information is provided by the Qt Style Sheets Reference and a detailled description is here: "CSS3 Draft Spec":http://www.w3.org/TR/css3-background/#border-image-process
-
wrote on 25 Feb 2014, 14:39 last edited by
I will have a look at it, thank you very much !
3/7