Навигация
SelectorBar Панель выбора
Строка выбираемых элементов для переключения между представлениями.
Пример
Не удалось загрузить предпросмотр свойств. Выберите предпросмотр свойств ещё раз для повтора.

Использование
SelectorBar со встроенными страницами
Добавляйте элементы с помощью addItem() и обрабатывайте currentChanged или selectionChanged для переключения страниц или фильтров.
#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
ОбъявлениеНет подходящих элементов API.