[Solved] Change color of push button
-
Hi Folks,
I would like to create a pushBotton on my UI, but I need to change its color by specific user action. The first, I tried to change it on the UI designer: I clicked on the styleSheet property, but the setted color doesn't have any affect.
Can anybody help me, how can I change the color?Regards,
Norbert -
Hi,
if I open the styleSheet editor, I see the following line:
@
color: rgb(97, 255, 24);
@This is some green color, but my buttons appers with the default grey color.
Regards,
NorbertUpdate:
I found the following solution that works for me (little bit in pseudo code):
@
QPushButton instance->setStyleSheet("border: 1px; border-radius: 6px; background-color: " + QColor instance.name());
@The "simple" change of the background-color didn't work, because the "border" property was not specified.
Regards,
Norbert