Skip to main content

QCustomDateEdit

QCustomDateEdit

/ QCustomTimeEdit / QCustomDateRangeEdit

Tokenized date & time inputs built on Qt's date/time editors (correct calendar popup, keyboard entry and validation) plus a two-field date range picker that keeps start <= end. Styled from design tokens; the calendar popup is scoped via the object name "customCalendar".

At a glance​

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

Quick start​

from Custom_Widgets.QCustomDateTimeEdit import QCustomDateEdit

widget = QCustomDateEdit()

Dark theme​

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

QCustomDateEdit in dark theme

Properties​

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

PropertyTypeDefault
wrappingbool—
framebool—
alignmentQFlags<Qt::AlignmentFlag>—
readOnlybool—
buttonSymbolsQAbstractSpinBox::ButtonSymbols—
specialValueTextstring—
textstring—
acceleratedbool—
correctionModeQAbstractSpinBox::CorrectionMode—
acceptableInputbool—
keyboardTrackingbool—
showGroupSeparatorbool—
dateTimeQDateTime—
dateQDate—
timeQTime—
maximumDateTimeQDateTime—
minimumDateTimeQDateTime—
maximumDateQDate—
minimumDateQDate—
maximumTimeQTime—
minimumTimeQTime—
currentSectionQDateTimeEdit::Section—
displayedSectionsQFlags<QDateTimeEdit::Section>—
displayFormatstring—
calendarPopupbool—
currentSectionIndexint—
sectionCountint—
timeSpecQt::TimeSpec—
timeZoneQTimeZone—
dateQDate—
variantenum: primary/secondary/outline/ghost``outline
sizeVariantenum: sm/md/lg``md

Theming​

Colours come from the design tokens, so they follow the active theme. Roles used: surface, on-surface, surface-muted, outline, accent, on-primary, focus-ring.

See Design tokens.

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