Date & time
CalendarView
A calendar surface for browsing months and selecting dates.
Example

Usage
Browse and select dates
Click the title to zoom out to months and years.
#include <FluentQt/DateTime.h>
using namespace fluent::date_time;
auto* calendar = new CalendarView(this);
calendar->setSelectedDate(QDate::currentDate());import fluentqt
from PySide6.QtCore import QDate
calendar = fluentqt.CalendarView()
calendar.setSelectedDate(QDate.currentDate())API
DeclarationNo matching API members.
fluent::date_time::CalendarView
Inherits QWidget · FluentElement · QMLPlus
Fluent calendar surface for browsing and selecting dates across levels.
Constructors
Properties
QDate selectedDateSelected date; an invalid date represents no selection.
ReadselectedDate()WritesetSelectedDate()NotifyselectedDateChanged()QDate visibleMonthMonth currently displayed by CalendarView.
ReadvisibleMonth()WritesetVisibleMonth()NotifyvisibleMonthChanged()QDate minDateMinimum date accepted by the calendar surface.
ReadminDate()WritesetMinDate()NotifyminDateChanged()QDate maxDateMaximum date accepted by the calendar surface.
ReadmaxDate()WritesetMaxDate()NotifymaxDateChanged()QLocale localeLocale used for calendar names and the automatic first weekday.
Readlocale()WritesetLocale()NotifylocaleChanged()Qt::DayOfWeek firstDayOfWeekFirst day used when laying out calendar weeks.
ReadfirstDayOfWeek()WritesetFirstDayOfWeek()ResetresetFirstDayOfWeek()NotifyfirstDayOfWeekChanged()CalendarContentLevel contentLevelCalendar content level currently displayed.
ReadcontentLevel()WritesetContentLevel()NotifycontentLevelChanged()bool frameVisibleWhether CalendarView paints its outer frame.
ReadisFrameVisible()WritesetFrameVisible()NotifyframeVisibleChanged()
Methods
QDate selectedDate() constSelected date; an invalid date represents no selection.
QDate visibleMonth() constMonth currently displayed by CalendarView.
QDate minDate() constMinimum date accepted by the calendar surface.
QDate maxDate() constMaximum date accepted by the calendar surface.
QLocale locale() constLocale used for calendar names and the automatic first weekday.
Qt::DayOfWeek firstDayOfWeek() constFirst day used when laying out calendar weeks.
CalendarContentLevel contentLevel() constCalendar content level currently displayed.
bool isFrameVisible() constWhether CalendarView paints its outer frame.
void setSelectedDate(const QDate& date)Selected date; an invalid date represents no selection.
void setVisibleMonth(const QDate& month)Month currently displayed by CalendarView.
void setMinDate(const QDate& date)Minimum date accepted by the calendar surface.
void setMaxDate(const QDate& date)Maximum date accepted by the calendar surface.
void setLocale(const QLocale& locale)Locale used for calendar names and the automatic first weekday.
void setFirstDayOfWeek(Qt::DayOfWeek day)First day used when laying out calendar weeks.
void resetFirstDayOfWeek()First day used when laying out calendar weeks.
void setContentLevel(CalendarContentLevel level)Calendar content level currently displayed.
void setFrameVisible(bool visible)Whether CalendarView paints its outer frame.
Signals
void selectedDateChanged(const QDate& date)Selected date; an invalid date represents no selection.
void visibleMonthChanged(const QDate& month)Month currently displayed by CalendarView.
void minDateChanged(const QDate& date)Minimum date accepted by the calendar surface.
void maxDateChanged(const QDate& date)Maximum date accepted by the calendar surface.
void localeChanged(const QLocale& locale)Locale used for calendar names and the automatic first weekday.
void firstDayOfWeekChanged(Qt::DayOfWeek day)First day used when laying out calendar weeks.
void contentLevelChanged(CalendarContentLevel level)Calendar content level currently displayed.
void frameVisibleChanged(bool visible)Whether CalendarView paints its outer frame.
Enumerations
enum class CalendarContentLevelDayMonthYear
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() constResolves the theme used by this element, honoring an inherited QWidget override.
bool effectiveThemeUsesDarkAppearance() constReturns whether this element's effective theme uses dark-backed chrome.
bool setThemeOverrides(const QJsonObject& overrides)Component-facing token accessors.
QJsonObject themeOverrides() constReturns this element's authored overrides.
void clearThemeOverrides()Restores all token fields to global theme defaults.
const Colors& themeColorsRef() constNon-copying access to the active color set (for hot paint paths).
Material::AcrylicToken themeAcrylic() constMaterial, elevation, and adaptive layout tokens.
QColor themeBackdrop(bool active) constWindow-chrome backdrop color for the given activation state.
virtual void onThemeUpdated()Called after the global theme changes.
Enumerations
enum ThemeGlobal visual theme used when resolving design tokens.
Light = 0Dark = 1HighContrast = 2
Types and aliases
struct ColorsDesign 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 bind(const char* targetProp, QObject* source, const char* sourceProp, PropertyBinder::Direction dir = PropertyBinder::OneWay)Binds a source property to a property on the QWidget host.
BindingHandle bindManaged(const char* targetProp, QObject* source, const char* sourceProp, PropertyBinder::Direction direction = PropertyBinder::OneWay, BindingOptions options = {})Installs a managed direct binding on this QWidget host.
BindingHandle bindComputed(const char* targetProp, const QVector<BindingDependency>& dependencies, std::function<QVariant()> evaluate, BindingOptions options = {})Installs an explicit-dependency C++ expression on this QWidget host.
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