Skip to main content

QCustomRating

QCustomRating

A clickable star rating.

A row of stars; click to set the value, hover to preview. Read-only mode for display. Tokenized via a filled dynamic property on each star.

At a glance

TierFree (GPLv3)
Importfrom Custom_Widgets.QCustomRating import QCustomRating
Qt DesignerYes — drag it from the palette

Quick start

from Custom_Widgets.QCustomRating import QCustomRating

widget = QCustomRating()

Dark theme

Colours come from the design tokens, so the widget follows the app theme with no extra work.

QCustomRating in dark theme

Properties

Every property below is settable in code and in Qt Designer.

PropertyTypeDefault
maximumint5
valueint0
readOnlyboolFalse

Signals

Signal
valueChanged(int)

Methods

MethodDescription
maximum(*args, **kwargs)Maximum.
readOnly(*args, **kwargs)Read only.
setValue(v)Set the value.
value(*args, **kwargs)Value.
valueChanged(...)Value changed.

Theming

Colours come from the design tokens, so they follow the active theme. Roles used: warning, outline.

See Design tokens.

QCustomButtonGroup · QCustomCheckBox · QCustomColorPicker · QCustomComboBox · QCustomDateEdit · QCustomDateRangePicker · QCustomEmojiPicker · QCustomFileDropZone