Basic input
MultiSelectComboBox
A model-backed drop-down list for selecting, filtering, and clearing several options.
Example

Usage
Select several model rows
The selected rows are the value; toggling an item keeps the dropdown open.
#include <FluentQt/BasicInput.h>
using namespace fluent::basicinput;
auto* model = new QStringListModel(
{"Design", "Engineering", "Research", "Support"}, this);
auto* box = new MultiSelectComboBox(this);
box->setModel(model);
box->setPlaceholderText("Choose teams");
box->setAccessibleName("Teams");
box->setSelectedRows({0, 2});
box->setFixedWidth(280);
auto* status = new Label(this);
status->setFixedWidth(280);
status->setWordWrap(true);
auto updateStatus = [box, status] {
QStringList labels;
for (const QModelIndex& index : box->selectedIndexes())
labels << index.data().toString();
status->setText(QStringLiteral("Selected: %1")
.arg(labels.join(", ")));
};
connect(box, &MultiSelectComboBox::selectionChanged,
this, [=] { updateStatus(); });
updateStatus();import fluentqt
from PySide6.QtCore import QStringListModel
model = QStringListModel(
['Design', 'Engineering', 'Research', 'Support'],
root
)
box = fluentqt.MultiSelectComboBox()
box.setModel(model)
box.setPlaceholderText('Choose teams')
box.setAccessibleName('Teams')
box.setSelectedRows([0, 2])
box.setFixedWidth(280)
status = fluentqt.Label()
status.setFixedWidth(280)
status.setWordWrap(True)
def update_status(*_args):
labels = [index.data() for index in box.selectedIndexes()]
status.setText(f"Selected: {', '.join(labels)}")
box.selectionChanged.connect(update_status)API
DeclarationNo matching API members.
fluent::basicinput::MultiSelectComboBox
Inherits QWidget · FluentElement · QMLPlus
Model-backed Fluent dropdown for selecting several rows.
Constructors
Properties
QAbstractItemModel* modelCaller-owned source model displayed by the dropdown.
Readmodel()WritesetModel()NotifymodelChanged()QItemSelectionModel* selectionModelSelection model used as the component value.
ReadselectionModel()WritesetSelectionModel()NotifyselectionModelChanged()int modelColumnSource-model column used for labels and filtering.
ReadmodelColumn()WritesetModelColumn()NotifymodelColumnChanged()QModelIndex rootModelIndexSource-model root whose direct children form the option list.
ReadrootModelIndex()WritesetRootModelIndex()NotifyrootModelIndexChanged()QString placeholderTextText shown while no selectable row is selected.
ReadplaceholderText()WritesetPlaceholderText()NotifyplaceholderTextChanged()bool searchEnabledWhether a local substring-search field is shown in the popup.
ReadisSearchEnabled()WritesetSearchEnabled()NotifysearchEnabledChanged()QString searchPlaceholderTextPlaceholder text used by the popup search field.
ReadsearchPlaceholderText()WritesetSearchPlaceholderText()NotifysearchPlaceholderTextChanged()bool selectAllVisibleWhether the popup shows a tri-state select-all action.
ReadisSelectAllVisible()WritesetSelectAllVisible()NotifyselectAllVisibleChanged()int maximumVisibleItemsMaximum number of option rows visible before scrolling.
ReadmaximumVisibleItems()WritesetMaximumVisibleItems()NotifymaximumVisibleItemsChanged()bool isOpenLogical popup open state.
ReadisOpen()WritesetIsOpen()NotifyisOpenChanged()int selectedCountNumber of selected selectable rows under rootModelIndex.
ReadselectedCount()NotifyselectedCountChanged()
Methods
QAbstractItemModel* model() constCaller-owned source model displayed by the dropdown.
void setModel(QAbstractItemModel* model)Caller-owned source model displayed by the dropdown.
QItemSelectionModel* selectionModel() constSelection model used as the component value.
void setSelectionModel(QItemSelectionModel* selectionModel)Selection model used as the component value.
int modelColumn() constSource-model column used for labels and filtering.
void setModelColumn(int column)Source-model column used for labels and filtering.
QModelIndex rootModelIndex() constSource-model root whose direct children form the option list.
void setRootModelIndex(const QModelIndex& index)Source-model root whose direct children form the option list.
QString placeholderText() constText shown while no selectable row is selected.
void setPlaceholderText(const QString& text)Text shown while no selectable row is selected.
bool isSearchEnabled() constWhether a local substring-search field is shown in the popup.
void setSearchEnabled(bool enabled)Whether a local substring-search field is shown in the popup.
QString searchPlaceholderText() constPlaceholder text used by the popup search field.
void setSearchPlaceholderText(const QString& text)Placeholder text used by the popup search field.
bool isSelectAllVisible() constWhether the popup shows a tri-state select-all action.
void setSelectAllVisible(bool visible)Whether the popup shows a tri-state select-all action.
int maximumVisibleItems() constMaximum number of option rows visible before scrolling.
void setMaximumVisibleItems(int count)Maximum number of option rows visible before scrolling.
bool isOpen() constLogical popup open state.
int selectedCount() constNumber of selected selectable rows under rootModelIndex.
void setSelectedRows(const QList<int>& rows)Replaces selected rows under the active root.
void clearSelection()Clears selected rows under the active root.
void selectAll()Selects every enabled and selectable source row under the root.
void open()Opens the anchored dropdown.
void close()Closes the dropdown without rolling back selection.
void setIsOpen(bool open)Logical popup open state.
Signals
void modelChanged(QAbstractItemModel* model)Caller-owned source model displayed by the dropdown.
void selectionModelChanged(QItemSelectionModel* selectionModel)Selection model used as the component value.
void modelColumnChanged(int column)Source-model column used for labels and filtering.
void rootModelIndexChanged(const QModelIndex& index)Source-model root whose direct children form the option list.
void selectedCountChanged(int count)Number of selected selectable rows under rootModelIndex.
void placeholderTextChanged(const QString& text)Text shown while no selectable row is selected.
void searchEnabledChanged(bool enabled)Whether a local substring-search field is shown in the popup.
void searchPlaceholderTextChanged(const QString& text)Placeholder text used by the popup search field.
void selectAllVisibleChanged(bool visible)Whether the popup shows a tri-state select-all action.
void maximumVisibleItemsChanged(int count)Maximum number of option rows visible before scrolling.
void isOpenChanged(bool open)Logical popup open state.
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