Navigation
SelectorBar Barre de sélection
Une rangée d'éléments sélectionnables pour basculer entre les vues.
Exemple
Impossible de charger l'aperçu des propriétés. Sélectionnez Aperçu des propriétés pour réessayer.

Utilisation
SelectorBar avec pages hébergées
Ajoutez des éléments avec addItem() et gérez currentChanged ou selectionChanged pour changer de page ou de filtre.
#include <FluentQt/Navigation.h>
using namespace fluent::navigation;
auto* selector = new SelectorBar(this);
selector->addItem(SelectorBarItem("Inbox", Typography::Icons::Mail,
true, true, "inbox"));
selector->addItem(SelectorBarItem("Calendar", Typography::Icons::Calendar,
true, true, "calendar"));
selector->addItem(SelectorBarItem("Settings", Typography::Icons::Settings,
true, true, "settings"));
auto* host = new StackContentHost(this);
for (int i = 0; i < selector->itemCount(); ++i)
host->insertPage(i, createPage(selector->itemAt(i).text));
connect(selector, &SelectorBar::currentChanged,
host, [host](int index) { host->setCurrentIndex(index, 0, true); });
connect(selector, &SelectorBar::selectionChanged,
this, [](int, const SelectorBarItem& item) {
const auto key = item.data.toString();
});import fluentqt
selector = fluentqt.SelectorBar()
selector.addItem(
fluentqt.SelectorBarItem(
"Inbox",
fluentqt.Typography.Icons.Mail,
True,
True,
"inbox"
)
)
selector.addItem(
fluentqt.SelectorBarItem(
"Calendar",
fluentqt.Typography.Icons.Calendar,
True,
True,
"calendar"
)
)
selector.addItem(
fluentqt.SelectorBarItem(
"Settings",
fluentqt.Typography.Icons.Settings,
True,
True,
"settings"
)
)
host = fluentqt.StackContentHost()
for index in range(selector.itemCount()):
host.insertOwnedPage(index, create_page(selector.itemAt(index).text))
selector.currentChanged.connect(lambda index: host.setCurrentIndex(index, 0, True))
selector.selectionChanged.connect(lambda _index, item: item.data)API
DéclarationAucun membre d'API correspondant.