[Sharing]Create MultiColoured Radial PushButton



  • Dear Friends,
    Add this code to your QPushButton Stylesheet and you will get Radial Multi coloured PushButton.Modify the colours you want and have a native look.

    @QPushButton{ color: rgb(0, 0, 127); background-color: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5, stop:0 rgba(0, 0, 0, 0), stop:0.52 rgba(0, 0, 0, 0), stop:0.565 rgba(82, 121, 76, 33), stop:0.65 rgba(159, 235, 148, 64), stop:0.721925 rgba(255, 238, 150, 129), stop:0.77 rgba(255, 128, 128, 204), stop:0.89 rgba(191, 128, 255, 64), stop:1 rgba(0, 0, 0, 0)); font: 18px "Dejavu Sans"; border:2px; }
    QPushButton:pressed { color: rgb(0, 0, 127); background-color: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5, stop:0 rgba(255,255,255,255), stop:0.52 rgba(255, 255, 255, 200), stop:0.565 rgba(0, 0, 0, 255), stop:0.65 rgba(199, 255, 198, 104), stop:0.721925 rgba(255, 255, 190, 169), stop:0.77 rgba(255, 168, 168, 224), stop:0.89 rgba(201, 148, 255, 84), stop:1 rgba(0, 0, 0, 0)); font: 22px "Dejavu Sans"; border:4px; }@


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.