Basic input
ComboBox
A drop-down list for selecting one item from a set of options.
Example

Usage
ComboBox selection
Selecting an item updates the current index and current text.
#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 custom popup and token-driven button surface.
Constructors
Properties
Typography::FontRole fontRoleFluent typography role used for text rendering.
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 used by the painted surface.
ReadpressProgress()WritesetPressProgress()QString trailingText- Read
trailingText()WritesetTrailingText()NotifytrailingTextChanged() QWidget* trailingWidget- Read
trailingWidget()NotifytrailingWidgetChanged() fluent::WidgetOwnership trailingWidgetOwnership- Read
trailingWidgetOwnership()NotifytrailingWidgetOwnershipChanged()
Methods
Typography::FontRole fontRole() const--- Appearance ---
void setFontRole(Typography::FontRole role)Restores theme-managed typography, even when the role is 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 used by the painted surface.
void setPressProgress(qreal p)Animated press progress used by the painted surface.
void setEditable(bool editable)--- Editable ---
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 editing modes without changing item values.
bool setTrailingWidget(QWidget* widget, WidgetOwnership ownership)Hosts one trailing widget outside the editor, replacing suffix text.
QWidget* takeTrailingWidget()Detaches custom trailing content and transfers it to the caller.
void releaseTrailingWidget()Releases custom trailing content according to its recorded ownership policy.
QAbstractItemModel* model() const--- QComboBox overrides ---
Signals
void fontRoleChanged()Fluent typography role used for text rendering.
void layoutChanged()Horizontal content padding in pixels.
void chevronChanged()Iconfont glyph used for the chevron affordance.
Destructors
PySide6 additions
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:QComboBox
fluent::basicinput::ComboBoxItemDelegate
Inherits QStyledItemDelegate
─── ComboBox popup delegate.