导航
Pivot 枢轴导航
在同级页面之间切换的标签导航。
示例

用法
切换页面
addItem() 添加标签,currentChanged 时切换 StackContentHost 中的页面;禁用的标签仍会显示,但不能选择。
#include <FluentQt/Navigation.h>
using namespace fluent::navigation;
auto* pivot = new Pivot(this);
pivot->addItem({"All", Typography::Icons::Mail});
pivot->addItem({"Unread", Typography::Icons::Filter});
pivot->addItem({"Flagged", Typography::Icons::Flag});
pivot->addItem({"Locked", Typography::Icons::Lock, false});
pivot->addItem({"Mentions", Typography::Icons::Contact});
auto* host = new StackContentHost(this);
for (int i = 0; i < pivot->itemCount(); ++i)
host->insertPage(i, createPage(pivot->itemAt(i).header));
connect(pivot, &Pivot::currentChanged,
host, [host](int index) { host->setCurrentIndex(index, 0, true); });import fluentqt
pivot = fluentqt.Pivot()
pivot.addItem(fluentqt.PivotItem("All", fluentqt.Typography.Icons.Mail))
pivot.addItem(fluentqt.PivotItem("Unread", fluentqt.Typography.Icons.Filter))
pivot.addItem(fluentqt.PivotItem("Flagged", fluentqt.Typography.Icons.Flag))
pivot.addItem(fluentqt.PivotItem("Locked", fluentqt.Typography.Icons.Lock, False))
pivot.addItem(fluentqt.PivotItem("Mentions", fluentqt.Typography.Icons.Contact))
host = fluentqt.StackContentHost()
for index in range(pivot.itemCount()):
host.insertOwnedPage(index, create_page(pivot.itemAt(index).header))
pivot.currentChanged.connect(lambda index: host.setCurrentIndex(index, 0, True))API
查看声明没有匹配的 API 成员。