Skip to main content

QCustomDateRangePicker

QCustomDateRangePicker

An INLINE dual-month range calendar.

The travel-dates / booking range picker: N month grids side by side, a painted in-range BAND between the two chosen days (rounded at the range ends and each week wrap), green endpoint circles, a "today" marker and month nav arrows. Click a day to set the start (clears the end); click a later day to set the end. This is the piece the compact popup QCustomDateRangeEdit lacks.

Painted with QPainter; the month panels flex to the widget and stack vertically when it is too narrow. Colours are qproperties so they flip with the theme. API: setStartDate/setEndDate/setRange(QDate...), monthsVisible; navigation arrows; signal rangeChanged(QDate start, QDate end).

At a glance

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

Quick start

from Custom_Widgets.QCustomDateRangePicker import QCustomDateRangePicker

widget = QCustomDateRangePicker()

Dark theme

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

QCustomDateRangePicker in dark theme

Properties

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

PropertyTypeDefault
monthsVisibleint2
accentColorcolor#2f8f5b
rangeBandColorcolor#e9edf0
todayColorcolor#2f8f5b
textColorcolor#1c2430
mutedColorcolor#aab2bd
headerColorcolor#1c2430
selectedTextColorcolor#ffffff

Signals

Signal
rangeChanged(QDate,QDate)

Methods

MethodDescription
accentColor(*args, **kwargs)Accent color.
endDate()End date.
headerColor(*args, **kwargs)Header color.
monthsVisible(*args, **kwargs)Months visible.
mutedColor(*args, **kwargs)Muted color.
rangeBandColor(*args, **kwargs)Range band color.
rangeChanged(...)Range changed.
selectedTextColor(*args, **kwargs)Selected text color.
setEndDate(d)Set the end date.
setMonthsVisible(n)Set the months visible.
setRange(start, end)Set the range.
setSelectableRange(minimum, maximum)Set the selectable range.
setStartDate(d)Set the start date.
showMonth(year, month)Show the month.
startDate()Start the date.
textColor(*args, **kwargs)Text color.
todayColor(*args, **kwargs)Today color.

Theming

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

See Design tokens.

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