Navigation
TabView Registerkartenansicht
Eine Registerkartenleiste mit Auswahl, Schließen und Neuanordnung per Ziehen; die Seiten werden von Ihrer App bereitgestellt.
Beispiel
Die Eigenschaftsvorschau konnte nicht geladen werden. Wählen Sie „Eigenschaftsvorschau“, um es erneut zu versuchen.

Verwendung
TabView mit gehosteten Seiten
currentChanged verbinden, um einen StackContentHost zu synchronisieren, und tabMoved behandeln, wenn setTabReorderEnabled(true) aktiviert ist.
#include <FluentQt/Navigation.h>
using namespace fluent::navigation;
auto* surface = new QWidget(this);
surface->setMinimumWidth(360);
surface->setMaximumWidth(560);
surface->setFixedHeight(186);
surface->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
auto* layout = new QVBoxLayout(surface);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
auto* tabs = new TabView(surface);
tabs->setFixedHeight(40);
tabs->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
tabs->setTabWidthMode(TabView::TabWidthMode::SizeToContent);
tabs->setTabReorderEnabled(true);
tabs->setTabsClosable(false);
tabs->setAddTabButtonVisible(false);
tabs->addTab(TabViewItem("Home", Typography::Icons::Home));
tabs->addTab(TabViewItem("Details", Typography::Icons::Document));
tabs->addTab(TabViewItem("Activity", Typography::Icons::Calendar));
auto* host = new StackContentHost(surface);
host->setFixedHeight(146);
host->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
for (int i = 0; i < tabs->tabCount(); ++i)
host->insertPage(i, createPage(tabs->tabAt(i).text));
connect(tabs, &TabView::currentChanged,
host, [host](int index) { host->setCurrentIndex(index, 0, true); });
connect(tabs, &TabView::tabMoved,
host, [host](int from, int to) { host->movePage(from, to); });
layout->addWidget(tabs);
layout->addWidget(host);import fluentqt
from PySide6.QtWidgets import QSizePolicy, QVBoxLayout, QWidget
surface = QWidget()
surface.setMinimumWidth(360)
surface.setMaximumWidth(560)
surface.setFixedHeight(186)
surface.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
surface_layout = QVBoxLayout(surface)
surface_layout.setContentsMargins(0, 0, 0, 0)
surface_layout.setSpacing(0)
tabs = fluentqt.TabView(surface)
tabs.setFixedHeight(40)
tabs.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
tabs.setTabWidthMode(fluentqt.TabView.TabWidthMode.SizeToContent)
tabs.setTabReorderEnabled(True)
tabs.setTabsClosable(False)
tabs.setAddTabButtonVisible(False)
tabs.addTab(fluentqt.TabViewItem("Home", fluentqt.Typography.Icons.Home))
tabs.addTab(fluentqt.TabViewItem("Details", fluentqt.Typography.Icons.Document))
tabs.addTab(fluentqt.TabViewItem("Activity", fluentqt.Typography.Icons.Calendar))
host = fluentqt.StackContentHost(surface)
host.setFixedHeight(146)
host.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
for index in range(tabs.tabCount()):
host.insertOwnedPage(index, create_page(tabs.tabAt(index).text))
tabs.currentChanged.connect(lambda index: host.setCurrentIndex(index, 0, True))
tabs.tabMoved.connect(host.movePage)
surface_layout.addWidget(tabs)
surface_layout.addWidget(host)API
DeklarationKeine passenden API-Elemente.