Fluent-Qt

Date & time

DateTimeRangePicker

A compact range entry with a calendar popup, minute precision, quick presets, and independently optional bounds.

Example

DateTimeRangePicker: Filter by a date range

Usage

Filter by a date range

Open the compact entry, select two dates, or choose a whole-day preset. Query inclusion belongs to the application.

#include <FluentQt/DateTime.h>
using namespace fluent::date_time;

auto* picker = new DateTimeRangePicker(this);
picker->setStartLabelText("Start");
picker->setEndLabelText("End");
picker->setTimeEnabled(false);
picker->setRange(QDateTime(QDate(2025, 10, 1), QTime(0, 0)),
                 QDateTime(QDate(2025, 11, 1), QTime(0, 0)));

fluent::date_time::DateTimeRangePicker

Inherits QWidget · FluentElement · QMLPlus

Compact range entry with a calendar flyout and independently nullable endpoints.

Constructors

Properties

QDateTime startDateTime
Read startDateTime()Write setStartDateTime()Reset clearStart()Notify startDateTimeChanged()
QDateTime endDateTime
Read endDateTime()Write setEndDateTime()Reset clearEnd()Notify endDateTimeChanged()
bool timeEnabled
Read isTimeEnabled()Write setTimeEnabled()Notify timeEnabledChanged()
bool rangeValid
Read isRangeValid()Notify rangeValidityChanged()
QString startLabelText
Read startLabelText()Write setStartLabelText()Notify startLabelTextChanged()
QString endLabelText
Read endLabelText()Write setEndLabelText()Notify endLabelTextChanged()
QString invalidRangeText
Read invalidRangeText()Write setInvalidRangeText()Notify invalidRangeTextChanged()
QLocale locale
Read locale()Write setLocale()Notify localeChanged()
QString placeholderText
Read placeholderText()Write setPlaceholderText()Notify placeholderTextChanged()
bool pickerOpen
Read isPickerOpen()Write setPickerOpen()Notify pickerOpenChanged()
bool presetsVisible
Read isPresetsVisible()Write setPresetsVisible()Notify presetsVisibleChanged()
bool autoApplyPresetsEnabled
Read isAutoApplyPresetsEnabled()Write setAutoApplyPresetsEnabled()Notify autoApplyPresetsEnabledChanged()

Methods

basicinput::Button* entryButton() const
CalendarView* calendarView() const

Returns the picker-owned range calendar for navigation and week settings.

CalendarDatePicker* startDatePicker() const

Returns picker-owned inputs for formatting and accessibility setup.

void setRange(const QDateTime& start, const QDateTime& end)

Updates both endpoints before emitting their change signals.

void setTimeEnabled(bool enabled)

Shows time inputs or normalizes both endpoints to midnight.

void openPicker()

Opens the same-window range calendar, endpoint editors, and presets.

void applyPreset(Preset preset)

Applies a built-in preset relative to local today or a supplied reference.

Signals

void presetRequested(Preset preset)

Requests a shortcut; disable auto application to supply business ranges.

Enumerations

enum class Preset

Built-in rolling calendar ranges including the reference day.

  • Today
  • Yesterday
  • PastWeek
  • PastMonth
  • PastSixMonths
  • PastYear

Destructors

Subclass interfaces

Methods

Inherited from fluent::FluentElement

Methods

static void setTheme(Theme theme)

Updates the global theme and notifies active FluentElement instances.

static void setThemeDeferred(Theme theme)

Schedules a visible-first batched theme refresh without blocking the current interaction.

static Theme currentTheme()

Returns the currently active global theme.

static bool themeUsesDarkAppearance(Theme theme)

Returns whether a theme uses dark-backed chrome and material tokens.

static void refreshTheme()

Re-broadcasts the current theme to repaint after a design-token change.

static int themeGeneration()

Monotonic counter bumped on every theme change, for staleness checks.

Theme effectiveTheme() const

Resolves the theme used by this element, honoring an inherited QWidget override.

bool effectiveThemeUsesDarkAppearance() const

Returns whether this element's effective theme uses dark-backed chrome.

QJsonObject themeOverrides() const

Returns this element's authored overrides.

void clearThemeOverrides()

Restores all token fields to global theme defaults.

const Colors& themeColorsRef() const

Non-copying access to the active color set (for hot paint paths).

Material::AcrylicToken themeAcrylic() const

Material, elevation, and adaptive layout tokens.

QColor themeBackdrop(bool active) const

Window-chrome backdrop color for the given activation state.

virtual void onThemeUpdated()

Called after the global theme changes.

Enumerations

enum Theme

Global visual theme used when resolving design tokens.

  • Light = 0
  • Dark = 1
  • HighContrast = 2

Types and aliases

struct Colors

Design token snapshots returned to components.

Inherited from fluent::QMLPlus

Methods

AnchorLayout::Anchors* anchors()

Returns mutable anchors for the QWidget host.

void setState(const QString& name)

Applies a named state, or clears state when name is empty.

void addState(const QMLState& state)

Registers or replaces a named state definition.

void evaluateStates()

Reevaluates conditions; the first registered true condition wins.

QMLPlusRuntime* runtime()

Returns the lazy host-owned state observation object.

void setAnchors(const AnchorLayout::Anchors& anchors)

Replaces all host anchors and invalidates the parent layout.

void resetAnchors()

Clears all host anchors and invalidates the parent layout.

void addTransition(const StateTransition& transition)

Registers a state transition in precedence order.

void setBehavior(const char* propertyName, const PropertyAnimation& animation)

Sets the default animation for this host's managed property writes.

void clearBehavior(const char* propertyName)

Removes the default animation for future managed writes.

bool writeProperty(const char* propertyName, const QVariant& value)

Writes a host property through Behavior without removing its binding.

All inherited Qt members:QWidget