Change text color for QML controls

roundtheworld picture roundtheworld · Aug 27, 2013 · Viewed 18.8k times · Source

I am using some QML controls like GroupBox and CheckBox which have text associated with them. The default color of the text is black. However, I have these items on a dark background and would prefer using white for the text color. These items don't have a color property so I'm not sure what to do.

CheckBox {
    text: "Check Me"
}

Answer

luffy picture luffy · Jan 19, 2015

I had the same problem with GroupBox so I wanted to post an answer for future reference. The problem can easily be fixed using HTML formatting. For instance to change the color:

GroupBox{ 
    title: "<font color=\"white\">my title</font>"
}

Size and other formatting parameters can be changed the same way.