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
| Tier | Free (GPLv3) |
| Import | from Custom_Widgets.QCustomDateRangePicker import QCustomDateRangePicker |
| Qt Designer | Yes — 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.
Properties
Every property below is settable in code and in Qt Designer.
| Property | Type | Default |
|---|---|---|
monthsVisible | int | 2 |
accentColor | color | #2f8f5b |
rangeBandColor | color | #e9edf0 |
todayColor | color | #2f8f5b |
textColor | color | #1c2430 |
mutedColor | color | #aab2bd |
headerColor | color | #1c2430 |
selectedTextColor | color | #ffffff |
Signals
| Signal |
|---|
rangeChanged(QDate,QDate) |
Methods
| Method | Description |
|---|---|
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.
Related
QCustomButtonGroup · QCustomCheckBox · QCustomColorPicker · QCustomComboBox · QCustomDateEdit · QCustomEmojiPicker · QCustomFileDropZone · QCustomForm