Skip to main content

QCustomPageDots

QCustomPageDots

A carousel / pager page indicator.

A row (or column) of dots where the active page is drawn as an elongated pill. Painted with QPainter so it stays crisp at any size and needs no child widgets. Optionally clickable: clicking a dot sets it active and emits pageChanged(index), so it can drive a QStackedWidget / carousel directly.

At a glance

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

Quick start

from Custom_Widgets.QCustomPageDots import QCustomPageDots

widget = QCustomPageDots()

Dark theme

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

QCustomPageDots in dark theme

Properties

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

PropertyTypeDefault
countint3
activeIndexint0
dotColorcolor#d7dbe6
activeColorcolor#3355e8
dotDiameterint8
activePillLengthint22
spacingint6
orientationenum: horizontal/vertical``horizontal
clickableboolTrue

Signals

Signal
pageChanged(int)

Methods

MethodDescription
activeColor(*args, **kwargs)Active color.
activeIndex(*args, **kwargs)Active index.
activePillLength(*args, **kwargs)Active pill length.
bindTo(control)Two-way bind the dots to any paged control (QCustomSegmentedControl,
clickable(*args, **kwargs)Clickable.
count(*args, **kwargs)Count.
dotColor(*args, **kwargs)Dot color.
dotDiameter(*args, **kwargs)Dot diameter.
orientation(*args, **kwargs)Orientation.
pageChanged(...)Page changed.
setActiveIndex(i)Set the active index.
setColors(dot=None, active=None)Set the colors.
setCount(n)Set the count.
spacing(*args, **kwargs)Spacing.

Theming

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

See Design tokens.

AnalogGaugeWidget · QCustomAgendaList · QCustomAlert · QCustomAvatar · QCustomAvatarGroup · QCustomBadge · QCustomCard · QCustomChip