Hello,
I have a class called TCalendarButton and it inherits from QLabel. The idea of this class is to represent the days of a calendar. So, on holidays, the text is supposed to be red, but when the number is pressed a green border around the number is supposed to be shown.
The border is created using this:
|
Source code
|
1
|
setFrameStyle( Box | Plain );
|
It is working for the normal days, but for the holidays, when I do:
|
Source code
|
1
2
3
|
QPalette palet;
palet.setColor( QPalette::WindowText, Qt::red );
setPalette( palet );
|
The border of this number becomes red too. I've tried some different roles in palette's setColor but I couln't find a way to make the boarder color to be different of the text color.
I could change the text color using the:
|
Source code
|
1
|
<font color=...></font>
|
In the text, but I wouldn't like to change the text of the label, as the code is too big and I'm affraid of side effects. I've thought about rewriting the "text()" function to remove the <font> tag, but the QLabel's "text()" is not virtual.
Is there an easy way to make the text color and the font color differents for this situation?
Thanks,
Renan Greinert