Navegación
TabView Vista de pestañas
Barra de pestañas con selección, cierre y reordenación al arrastrar; tu aplicación aloja las páginas.
Ejemplo
No se pudo cargar la vista previa de propiedades. Selecciona Vista previa de propiedades para reintentar.

Uso
TabView con páginas alojadas
Conecta currentChanged para sincronizar un StackContentHost y gestiona tabMoved cuando setTabReorderEnabled(true) está activado.
#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
DeclaraciónNo hay miembros de la API que coincidan.