Basic input
ComboBox
A drop-down list for selecting one item from a set of options.
Example
Property preview could not load. Select Property preview to retry.

Usage
ComboBox selection
Add options with addItems(), listen to currentIndexChanged, and read the selected label via currentText(). Placeholder text shows when nothing is selected and input is empty (in editable mode, set it on lineEdit()).
#include <FluentQt/BasicInput.h>
using namespace fluent::basicinput;
auto* comboBox = new ComboBox(this);
comboBox->addItems({"Blue", "Green", "Red", "Yellow"});
comboBox->setCurrentIndex(0);
connect(comboBox, qOverload<int>(&ComboBox::currentIndexChanged),
this, [=](int index) {
status->setText(comboBox->currentText());
});import fluentqt
combo_box = fluentqt.ComboBox()
combo_box.addItems(['Blue', 'Green', 'Red', 'Yellow'])
combo_box.setCurrentIndex(0)
combo_box.currentIndexChanged.connect(
lambda _index: status.setText(f"Selected: {combo_box.currentText()}")
)API
DeclarationNo matching API members.
fluent::basicinput::ComboBox
Inherits QComboBox · FluentElement · QMLPlus
Fluent combo box with a custom popup list, optional editable input, and trailing slot.
Constructors
Properties
Typography::FontRole fontRoleFluent Typography preset used for text.
ReadfontRole()WritesetFontRole()NotifyfontRoleChanged()int contentPaddingHHorizontal content padding in pixels.
ReadcontentPaddingH()WritesetContentPaddingH()NotifylayoutChanged()int contentPaddingVVertical content padding in pixels.
ReadcontentPaddingV()WritesetContentPaddingV()NotifylayoutChanged()QString chevronGlyphIconfont glyph used for the chevron affordance.
ReadchevronGlyph()WritesetChevronGlyph()NotifychevronChanged()int chevronSizeChevron glyph pixel size.
ReadchevronSize()WritesetChevronSize()NotifychevronChanged()QPoint chevronOffsetPixel offset applied to chevron drawing.
ReadchevronOffset()WritesetChevronOffset()NotifychevronChanged()int popupOffsetPopup offset from its anchor in pixels.
ReadpopupOffset()WritesetPopupOffset()NotifylayoutChanged()qreal pressProgressAnimated press progress for chevron click feedback.
ReadpressProgress()WritesetPressProgress()QString trailingText- Read
trailingText()WritesetTrailingText()NotifytrailingTextChanged() QWidget* trailingWidget- Read
trailingWidget()NotifytrailingWidgetChanged() fluent::WidgetOwnership trailingWidgetOwnership- Read
trailingWidgetOwnership()NotifytrailingWidgetOwnershipChanged()
Methods
Typography::FontRole fontRole() constFluent Typography preset used for text.
void setFontRole(Typography::FontRole role)Applies the Fluent Typography preset and clears any explicit font override, even if unchanged.
void setFont(const QFont& font)Sets the field, editor and dropdown font independently of theme refreshes.
int contentPaddingH() constHorizontal content padding in pixels.
void setContentPaddingH(int px)Horizontal content padding in pixels.
int contentPaddingV() constVertical content padding in pixels.
void setContentPaddingV(int px)Vertical content padding in pixels.
QString chevronGlyph() constIconfont glyph used for the chevron affordance.
void setChevronGlyph(const QString& glyph)Iconfont glyph used for the chevron affordance.
int chevronSize() constChevron glyph pixel size.
void setChevronSize(int size)Chevron glyph pixel size.
QPoint chevronOffset() constPixel offset applied to chevron drawing.
void setChevronOffset(const QPoint& offset)Pixel offset applied to chevron drawing.
int popupOffset() constPopup offset from its anchor in pixels.
void setPopupOffset(int offset)Popup offset from its anchor in pixels.
qreal pressProgress() constAnimated press progress for chevron click feedback.
void setPressProgress(qreal p)Animated press progress for chevron click feedback.
void setEditable(bool editable)Enables or disables editable mode using a Fluent LineEdit.
void setLineEdit(QLineEdit* edit)Replaces the QComboBox editor and synchronizes Fluent layout state.
void setTrailingText(const QString& text)Displays a plain-text suffix in both editable and non-editable modes without changing item values.
bool setTrailingWidget(QWidget* widget, WidgetOwnership ownership)Places a trailing widget beside the text or editor, replacing any suffix text. Pass WidgetOwnership to specify cleanup; call takeTrailingWidget() before changing it.
QWidget* takeTrailingWidget()Removes and returns the trailing widget for the caller to manage or delete.
void releaseTrailingWidget()Removes the trailing widget and handles cleanup according to its WidgetOwnership mode.
void setModel(QAbstractItemModel* model) FLUENT_QT6_ONLY_OVERRIDESets the item model (still managed by the caller; not deleted by this control).
Signals
void fontRoleChanged()Fluent Typography preset used for text.
void layoutChanged()Horizontal content padding in pixels.
void chevronChanged()Iconfont glyph used for the chevron affordance.
Destructors
PySide6 additions
Protected members
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)Replaces this element's sparse color, radius, and font token overrides.
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 registered state by name, or restores the default state when @p name is empty. Unknown names are ignored, and existing bindings resume when leaving the state.
void addState(const QMLState& state)Registers or replaces a named state definition; replacing the active state applies it immediately.
void evaluateStates()Reevaluates state conditions in registration order and activates the first match, or the default state if none match. Also runs automatically when dependency properties notify; derived states using extend inherit ancestor changes unless cyclic or missing.
QMLPlusRuntime* runtime()Returns the lazily created state observer owned by this host.
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 @p sourceProp on @p source to @p targetProp on this QWidget host via PropertyBinder::bind().
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 used when @p propertyName is written via writeProperty() or a binding. Explicit StateTransition rules take precedence; direct C++ setter calls are not animated.
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.
Qt base class docs: QComboBox
fluent::basicinput::ComboBoxItemDelegate
Inherits QStyledItemDelegate
Item delegate that renders ComboBox popup rows with Fluent metrics and theme colors.