I would like to change a backcolor theme of a QPushButton being Pressed. I am using QT Creator 2 and Windows 7. Here is the code. I tried using the StyleSheet option and it works fine, but in this case I will have a color dialog that will return the color that the button will need to change to. I would like the color not be solid, but gradient like it is by default but with a different themeColor.
Code:
if ( button->text() != "Pressed") { button->setText("Pressed"); QColorDialog *myColorDialog; QColor theColorPicked; QPalette thePal; thePal.setColor(button->backgroundRole(),theColorPicked); button->setPalette(thePal);