QPalette works differently on windows and linux
hi
i want to change color of push button .
the does this in linux but in windows it does not work .
Code:
#include <QtGui>
int main(int argc, char *argv[])
{
b.show();
b.setPalette(palette);
return a.exec();
}
the above program displays a pushbutton in green color in linux, but the same program after compiling in windows and running the color of pushbutton is not green in color.
the same is with the designer. i can change the color of pushbutton using designer in linux but in windows it does not work.
Re: QPalette works differently on windows and linux
Yes, it doesn't work on WinXP because QWindowsXpStyle uses native theming engine. It wouldn't work on Mac either.
Next time, please search the forums before starting new threads. This question has been asked and answered (too) many times, last time yesterday. There's even a FAQ entry: How to change the colour of a button or any other Qt widget?
Re: QPalette works differently on windows and linux
thanks for the link jpn.
in the link the code sets pushbutton to red color.
Code:
button->setStyleSheet("color: #0000dd; background-color: red;");
but even if we use
Code:
button->setStyleSheet("background-color: red;");
this we get the same ,then what does color: #0000dd signify and do we really need it. i have gone through the docs(The Style Sheet Syntax) and i have not found any thing like this.
Re: QPalette works differently on windows and linux
Quote:
Originally Posted by
babu198649
i have gone through the docs(The Style Sheet Syntax) and i have not found any thing like this.
Really? It's all explained in the list of stylable properties: http://doc.trolltech.com/4.3/stylesh...tml#color-prop