Date & time
TimePicker
A spinning-field picker for choosing a time of day.
Example

Usage
Spinning-field time picker
Clicking opens looping hour and minute columns.
#include <FluentQt/DateTime.h>
using namespace fluent::date_time;
auto* picker = new TimePicker(this);
picker->setPlaceholderText(TimePicker::TimeField::Hour, "hour");
picker->setPlaceholderText(TimePicker::TimeField::Minute, "minute");
picker->setPlaceholderText(TimePicker::TimeField::Period, "AM/PM");
picker->setConfirmButtonAccessibleName("Accept time");
picker->setCancelButtonAccessibleName("Cancel time");
picker->setTime(QTime(9, 30));
picker->setMinuteIncrement(5);import fluentqt
from PySide6.QtCore import QTime
picker = fluentqt.TimePicker()
picker.setPlaceholderText(fluentqt.TimePicker.TimeField.Hour, "hour")
picker.setPlaceholderText(fluentqt.TimePicker.TimeField.Minute, "minute")
picker.setPlaceholderText(fluentqt.TimePicker.TimeField.Period, "AM/PM")
picker.setConfirmButtonAccessibleName("Accept time")
picker.setCancelButtonAccessibleName("Cancel time")
picker.setTime(QTime(9, 30))
picker.setMinuteIncrement(5)API
DeclarationNo matching API members.
fluent::date_time::TimePicker
Inherits fluent::basicinput::Button
Button-like time picker with nullable selected-time semantics.
Constructors
Properties
QTime timeCurrent time value displayed by the picker.
Readtime()WritesetTime()NotifytimeChanged()QTime selectedTimeSelected time; an invalid time represents no selection.
ReadselectedTime()WritesetSelectedTime()ResetclearSelectedTime()NotifyselectedTimeChanged()int minuteIncrementMinute step used by the time picker.
ReadminuteIncrement()WritesetMinuteIncrement()NotifyminuteIncrementChanged()ClockIdentifier clockIdentifierClock mode used for time display and editing.
ReadclockIdentifier()WritesetClockIdentifier()NotifyclockIdentifierChanged()bool dropDownOpenWhether the picker dropdown is open.
ReadisDropDownOpen()NotifydropDownOpenChanged()QLocale localeLocale used for AM/PM period text.
Readlocale()WritesetLocale()NotifylocaleChanged()QString confirmButtonAccessibleNameAccessible name supplied by the application for the confirm button.
ReadconfirmButtonAccessibleName()WritesetConfirmButtonAccessibleName()NotifyconfirmButtonAccessibleNameChanged()QString cancelButtonAccessibleNameAccessible name supplied by the application for the cancel button.
ReadcancelButtonAccessibleName()WritesetCancelButtonAccessibleName()NotifycancelButtonAccessibleNameChanged()
Methods
QTime time() constCurrent time value displayed by the picker.
QTime selectedTime() constSelected time; an invalid time represents no selection.
int minuteIncrement() constMinute step used by the time picker.
ClockIdentifier clockIdentifier() constClock mode used for time display and editing.
QLocale locale() constLocale used for AM/PM period text.
bool isDropDownOpen() constWhether the picker dropdown is open.
QString confirmButtonAccessibleName() constAccessible name supplied by the application for the confirm button.
QString cancelButtonAccessibleName() constAccessible name supplied by the application for the cancel button.
void setTime(const QTime& time)Current time value displayed by the picker.
void setSelectedTime(const QTime& time)Selected time; an invalid time represents no selection.
void clearSelectedTime()Selected time; an invalid time represents no selection.
void setMinuteIncrement(int increment)Minute step used by the time picker.
void setClockIdentifier(ClockIdentifier identifier)Clock mode used for time display and editing.
void setLocale(const QLocale& locale)Locale used for AM/PM period text.
void setPlaceholderText(TimeField field, const QString& text)Sets application-owned placeholder text for one time field.
void setConfirmButtonAccessibleName(const QString& name)Accessible name supplied by the application for the confirm button.
void setCancelButtonAccessibleName(const QString& name)Accessible name supplied by the application for the cancel button.
Signals
void timeChanged(const QTime& time)Current time value displayed by the picker.
void selectedTimeChanged(const QTime& time)Selected time; an invalid time represents no selection.
void minuteIncrementChanged(int increment)Minute step used by the time picker.
void clockIdentifierChanged(TimePicker::ClockIdentifier identifier)Clock mode used for time display and editing.
void localeChanged(const QLocale& locale)Locale used for AM/PM period text.
void confirmButtonAccessibleNameChanged(const QString& name)Accessible name supplied by the application for the confirm button.
void cancelButtonAccessibleNameChanged(const QString& name)Accessible name supplied by the application for the cancel button.
void dropDownOpenChanged(bool open)Whether the picker dropdown is open.
Enumerations
enum class TimeFieldHourMinutePeriod
enum class ClockIdentifierTwelveHourClockTwentyFourHourClock
Destructors
Subclass interfaces
Methods
Inherited from fluent::basicinput::Button
Properties
ButtonStyle fluentStyleVisual treatment: Standard, Accent, or Subtle.
ReadfluentStyle()WritesetFluentStyle()NotifyfluentStyleChanged()ButtonSize fluentSizeDensity token that controls height and padding, not typography.
ReadfluentSize()WritesetFluentSize()NotifyfluentSizeChanged()Typography::FontRole fontRoleFluent typography role used while the button follows theme fonts.
ReadfontRole()WritesetFontRole()NotifyfontRoleChanged()TextColorRole textColorRoleSemantic foreground for unfilled, unchecked buttons; filled and disabled states keep their contrast roles.
ReadtextColorRole()WritesetTextColorRole()NotifytextColorRoleChanged()ButtonLayout fluentLayoutContent layout for text and icon placement.
ReadfluentLayout()WritesetFluentLayout()NotifyfluentLayoutChanged()bool focusVisualControls whether the focus visual frame is painted.
ReadhasFocusVisual()WritesetFocusVisual()NotifyfocusVisualChanged()InteractionState interactionStateOverrides the interaction state for guided demos or visual checks.
ReadinteractionState()WritesetInteractionState()NotifyinteractionStateChanged()bool criticalOnHoverUses the critical semantic color while hovered or pressed.
ReadcriticalOnHover()WritesetCriticalOnHover()NotifycriticalOnHoverChanged()QMargins cornerRadiiPer-corner radii; left/top/right/bottom map to top-left/top-right/bottom-right/bottom-left.
ReadcornerRadii()WritesetCornerRadii()ResetresetCornerRadii()NotifycornerRadiiChanged()QPoint iconOffsetPixel offset applied to iconfont drawing; positive values move right/down.
ReadiconOffset()WritesetIconOffset()qreal iconRotationClockwise rotation applied to the painted icon in degrees.
ReadiconRotation()WritesetIconRotation()qreal iconScaleUniform scale applied to the painted iconfont glyph (1.0 = no scaling). Drives WinUI-style press feedback (a brief scale-down) without touching geometry.
ReadiconScale()WritesetIconScale()qreal contentOpacityPainter-level opacity for the whole button surface (1.0 = fully opaque). A lightweight fade that avoids QGraphicsOpacityEffect's offscreen compositing.
ReadcontentOpacity()WritesetContentOpacity()
Methods
ButtonStyle fluentStyle() constFluent property accessors.
void setFluentStyle(ButtonStyle style)Visual treatment: Standard, Accent, or Subtle.
ButtonSize fluentSize() constDensity token that controls height and padding, not typography.
void setFluentSize(ButtonSize size)Density token that controls height and padding, not typography.
Typography::FontRole fontRole() constFluent typography role used while the button follows theme fonts.
void setFontRole(Typography::FontRole role)Fluent typography role used while the button follows theme fonts.
TextColorRole textColorRole() constSemantic foreground for unfilled, unchecked buttons; filled and disabled states keep their contrast roles.
void setTextColorRole(TextColorRole role)Semantic foreground for unfilled, unchecked buttons; filled and disabled states keep their contrast roles.
void setFont(const QFont& font)Sets an explicit font that remains unchanged by later theme refreshes.
ButtonLayout fluentLayout() constContent layout for text and icon placement.
void setFluentLayout(ButtonLayout layout)Content layout for text and icon placement.
bool hasFocusVisual() constControls whether the focus visual frame is painted.
void setFocusVisual(bool focus)Controls whether the focus visual frame is painted.
InteractionState interactionState() constOverrides the interaction state for guided demos or visual checks.
void setInteractionState(InteractionState state)Overrides the interaction state for guided demos or visual checks.
bool criticalOnHover() constUses the critical semantic color while hovered or pressed.
void setCriticalOnHover(bool enabled)Uses the critical semantic color while hovered or pressed.
QMargins cornerRadii() constPer-corner radii; left/top/right/bottom map to top-left/top-right/bottom-right/bottom-left.
void setCornerRadii(const QMargins& radii)Per-corner radii; left/top/right/bottom map to top-left/top-right/bottom-right/bottom-left.
void resetCornerRadii()Per-corner radii; left/top/right/bottom map to top-left/top-right/bottom-right/bottom-left.
QPoint iconOffset() constPixel offset applied to iconfont drawing; positive values move right/down.
void setIconOffset(const QPoint& offset)Pixel offset applied to iconfont drawing; positive values move right/down.
qreal iconRotation() constClockwise rotation applied to the painted icon in degrees.
void setIconRotation(qreal rotation)Clockwise rotation applied to the painted icon in degrees.
qreal iconScale() constUniform scale applied to the painted iconfont glyph (1.0 = no scaling). Drives WinUI-style press feedback (a brief scale-down) without touching geometry.
void setIconScale(qreal scale)Uniform scale applied to the painted iconfont glyph (1.0 = no scaling). Drives WinUI-style press feedback (a brief scale-down) without touching geometry.
qreal contentOpacity() constPainter-level opacity for the whole button surface (1.0 = fully opaque). A lightweight fade that avoids QGraphicsOpacityEffect's offscreen compositing.
void setContentOpacity(qreal opacity)Painter-level opacity for the whole button surface (1.0 = fully opaque). A lightweight fade that avoids QGraphicsOpacityEffect's offscreen compositing.
QSize sizeHint() const overrideSize hints include Fluent padding, text, and iconfont content.
void setIconGlyph(const QString& glyph, int pixelSize = Typography::IconSize::Standard, const QString& family = Typography::FontFamily::FluentIcons)Sets an iconfont glyph that is drawn directly during paintEvent().
Signals
void fluentStyleChanged()Visual treatment: Standard, Accent, or Subtle.
void fluentSizeChanged()Density token that controls height and padding, not typography.
void fontRoleChanged()Fluent typography role used while the button follows theme fonts.
void textColorRoleChanged()Semantic foreground for unfilled, unchecked buttons; filled and disabled states keep their contrast roles.
void fluentLayoutChanged()Content layout for text and icon placement.
void focusVisualChanged()Controls whether the focus visual frame is painted.
void interactionStateChanged()Overrides the interaction state for guided demos or visual checks.
void criticalOnHoverChanged()Uses the critical semantic color while hovered or pressed.
void cornerRadiiChanged()Per-corner radii; left/top/right/bottom map to top-left/top-right/bottom-right/bottom-left.
Enumerations
enum ButtonStyleButton visual style resolved against Fluent design tokens.
StandardAccentSubtle
enum ButtonSizeButton density presets for padding and preferred height.
SmallStandardSizeLarge
enum ButtonLayoutText/icon composition mode.
TextOnlyIconBeforeIconOnlyIconAfter
enum class TextColorRoleSemantic text and icon emphasis.
PrimarySecondaryAccent
enum InteractionStatePaint-state override used before falling back to real hover/press state.
RestHoverPressedDisabled
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:QPushButton