Font properties and stylesheets in the Designer
-
I have some difficulties to understand the behavior of fonts and stylesheets in the Designer
Here is an exampleI add a label and a Tab Widget

Apply a vertical layout

Change text and properties of the top label

Change Font size property of the Tab Widget to 12

Add a label to Tab 1 page and another below the Tab Widget

My first question
Why is the font size of the Label on the Tab Widget automatically changed to 12, the same size as for the text in the tabs

and the label outside the Tab Widget keeps the default size

I was expecting that the label added to Tab 1 would also feature the default size of 8
Now I add a few other Labels and a vertical layout to the Tab 1 page

I would like that the text in all labels in the Tab Widget are centered using Stylesheets
From the documentation I know that {text-align: center} is not supported for labels, but I found a post on this forum explaining that the following is working
QLabel {qproperty-alignment: AlignCenter;}So I right click on the tabs to open the Stylesheet window and add the above code

When I click Apply all the labels are centered as expected

But when I close the Stylesheet window the font size of the labels is set to the default value 8.

Why?
Worse, when I run the application the labels are even not centered

-
@Bert59 said in Font properties and stylesheets in the Designer:
Change Font size property of the Tab Widget to 12
Change Font size property of the Tab Widget to 12 <== for all contents in tab widget including all TextLabels.
if you want to change the font of text labels, you can set different font size to them separately.
QLabel has func setFont()Label { text: "Hello world" font.pixelSize: 22 <======== font.italic: true color: "steelblue" }