PDA

View Full Version : Property Editor doesn't work!



æž—å©·
28th August 2012, 03:32
Hello,
I tried to change the color of QLabel's text by changing the windowtext'color of the UI in the property editor.I could see the color of the text.color change,But when I run the application, the label's color goes back to the default "black"!How can I make the attribute work?

mardi
28th August 2012, 04:40
Hi

You could do that by edit the style sheet.



QLabel
{
border-width: 2px;
border-radius: 10px;
border-color: black; //put your color here
font: bold 9px;
padding: 6px;
}


Regards,

Mardi

ChrisW67
28th August 2012, 06:56
Hello,
I tried to change the color of QLabel's text by changing the windowtext'color of the UI in the property editor.I could see the color of the text.color change,But when I run the application, the label's color goes back to the default "black"!How can I make the attribute work?

Start by finding why it doesn't work. Is your UI file properly included in your project? Is your application being rebuilt when you modify the UI? Does anything else modify the label properties in the code? Have you applied a style sheet anywhere in your program?

waiter
29th August 2012, 07:06
It is better to use Qt style sheet,,,