I am creating a hyper link text through Qlabel but i am not able to change its color through Qpalette class?
I am able to change its color through stylesheet but why setting the color with QPalette is not working.
I have tried this
QPalette pal(label->palette ());
pal.setColor (QPalette::Text, QColor(255,255,0));
Did you read this warning in the [[doc:QPalette]] documentation?
[quote]Warning: Some styles do not use the palette for all drawing, for instance, if they make use of native theme engines. This is the case for both the Windows XP, Windows Vista, and the Mac OS X styles.[/quote]
So what should we use in place of QPalette for the same purpose.
[quote author="pratik041" date="1324378815"]So what should we use in place of QPalette for the same purpose.[/quote]
[quote author="pratik041" date="1324375284"]I am able to change its color through stylesheet (...)[/quote]
Seems to me you already answered your own question.