Skip to content

Add font-size and font-weight properties to CheckBox#11282

Open
dfaure-kdab wants to merge 1 commit intoslint-ui:masterfrom
dfaure-kdab:wip/dfaure/font-size-checkbox
Open

Add font-size and font-weight properties to CheckBox#11282
dfaure-kdab wants to merge 1 commit intoslint-ui:masterfrom
dfaure-kdab:wip/dfaure/font-size-checkbox

Conversation

@dfaure-kdab
Copy link
Copy Markdown
Collaborator

Expose font-size and font-weight as input properties on CheckBox across
all non-native styles (fluent, material, cupertino, cosmic), defaulting
to each style's existing font settings. This matches the pattern already
used by TextEdit, TextInput, and LineEdit.

These properties have no effect when using the Qt style, where the
entire widget (including text rendering) is delegated to NativeCheckBox
which paints via QStyle::drawControl.

dfaure pushed a commit to dfaure/videofinder that referenced this pull request Apr 6, 2026
Expose font-size and font-weight as input properties on CheckBox across
all non-native styles (fluent, material, cupertino, cosmic), defaulting
to each style's existing font settings. This matches the pattern already
used by TextEdit, TextInput, and LineEdit.

These properties have no effect when using the Qt style, where the
entire widget (including text rendering) is delegated to NativeCheckBox
which paints via QStyle::drawControl.
@dfaure-kdab dfaure-kdab force-pushed the wip/dfaure/font-size-checkbox branch from baf78ed to 8e9c42b Compare April 8, 2026 09:17
@ogoffart
Copy link
Copy Markdown
Member

ogoffart commented Apr 8, 2026

We need to discuss if we really want this. We probably do, but then we should have that consistently to all widgets.

I think @tronical have been wanting to have a more general property<Font> font: { size: ..., weight: ... }; that would reduce the need to add way too many property.

Relates to #4372

@dfaure-kdab
Copy link
Copy Markdown
Collaborator Author

Yeah. This solution is consistent with TextEdit, TextInput, and LineEdit, but means it's still missing from ComboBox etc.

A font property would make sense but only if one can specify the size without having to specify everything (especially hardcoding a font family name).

@tronical
Copy link
Copy Markdown
Member

tronical commented Apr 9, 2026

Yeah. This solution is consistent with TextEdit, TextInput, and LineEdit, but means it's still missing from ComboBox etc.

Agreed.

A font property would make sense but only if one can specify the size without having to specify everything (especially hardcoding a font family name).

Yes. The idea is to carry a Font struct in the implementation and additionally offer font-* properties for convenience (the example you described).

IMO this PR adds the API we want, and I want to make the implementation more lightweight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants