thank you for the example, it works just with :
pushButton_2->setStyleSheet("QPushButton {background : rgb(224, 0, 0);}");
The first button has not changed (QPalette)
the second buton come not clickable![]()
thank you for the example, it works just with :
pushButton_2->setStyleSheet("QPushButton {background : rgb(224, 0, 0);}");
The first button has not changed (QPalette)
the second buton come not clickable![]()
Last edited by omega36; 30th October 2008 at 14:06.
Hi i think this code is working properly..
QPalette lPalette;
lPalette.setColor(pb1->backgroundRole(),QColor(255,0,0));
pb1->setPalette(lPalette);
the above code is correct and u try it...
where pb1 is ur pushbutton![]()
even if the above code is correct, but... nothing happend
and this is my solution : I create a red .png - for exemple - with "MacromediaFireWorks" ,
I convert it to .ico and it's work with this code :
ui.pushButton->setIcon(QIcon("./icon/28.ico"));
thanks to all![]()
it's not a solution. it's woraround. you have to find a problem.![]()
try to de the next thing, open Qt Designer, create a widget and put on it a QPushButton and play with a palette settings of this button. what will you see?
I dont see any thing
it's a temporary solution
did you do this in designer and color of button did not change?
ps. packed by 7zip
I did the same..
even on the pallette all other controls change color except button
rebuild Qt and try again![]()
omega36, what version of Qt are you using?
maybe it's a bug in this version. anyway, did you try to run this code on another version of Qt?
omega36, Do you have a chance to try Qt 4.3 or 4.4?
I'm talking about this
Qt Code:
.... pixmap.fill(Qt::red); ...To copy to clipboard, switch view to plain text mode
sorry I read it quickly
ok that is better![]()
Bookmarks