Using a palette to set the color of a labels text in QtDesigner
-
In QtDesigner, I have a label. In the property editor, I clicked on "change palette" next to the "palette" property. Then I changed the "Text" active color to green. When I close the dialog, the text is still black. What am I missing here? I know you can also use css to color the text, but I'd like to do it via a palette if possible.
Any suggestions?
Thanks,
David
-
Hmm.. It looks very strange. Screenshot with explanation in a what way do you doing it?
-
Here is a screenshot. I have set this color, then closed the dialog and opened it again (so it has already been "applied"):
-
Styles are not required to actually use the palette. It might be your style ignores the palette. Does the same happen in previews using other styles?
-
How do I change styles in Designer?
It is worth noting that other widgets (like a LineEdit) do change text color correctly using the same approach.
Also, I find it strange that there is no Label in the collection of widgets in the "Preview" section of the Edit Palette, but there is almost every other standard widget?
Thanks,
David
-
What happens if you click Tools -> Form Editor -> Preview in... -> (one of the other styles) ?
-
Nope, with all styles the text is still black. Does it work for you?
-
You are right: it does not, and that is strange.
-
Andre - so what should I do? haha
Do you think this is an actual bug that I should report?
-
Perhaps you should, yes. When you do, please refer to this topic in your report, and report back with a link to the report in this topic.
-
Designer didn't seem to be an option to report bugs, so I posted it under Creator: https://bugreports.qt-project.org/browse/QTCREATORBUG-7638
-
Are you sure it is a creator bug, and not an issue with Qt itself?
-
Oh, no, maybe it is a Qt thing, since it doesn't show up correctly at run time either. I guess I was assuming it was just not getting set properly. It didn't look like I could list the bug in two categories - maybe I'll leave it here for a few days and move it if it doesn't get any attention?
-
If it doesn't show correctly at runtime either, then it is a Qt issue. The fact that QtCreator doesn't show the change is just a result of that. After all, QtCreator is build on Qt as well. :-)
-
As per comment in the bugreport by Volker:
The palette does work, but the role to use is the WindowText (top one in Designer).No clue why I missed that before.
-
Interesting... that did work. What is the difference between Text and WindowText?
Also, is there a reason that almost every basic widget is represented in the Edit Palette -> Preview Window except QLabel?
-
Now, that is a Qt Creator issue :-)
I guess it is because the labels of the checkboxes behave the same anyway?