Navigation
NavigationView Vue de navigation
Un volet gauche adaptatif accompagné d'une zone de contenu pour la navigation principale.
Exemple
Impossible de charger l'aperçu des propriétés. Sélectionnez Aperçu des propriétés pour réessayer.

Utilisation
Emplacements de structure
Les zones d'en-tête, principale et de pied de page sont des widgets appartenant à l'appelant ; NavigationView se charge uniquement de leur géométrie dans le cadre.
#include <FluentQt/Navigation.h>
using namespace fluent::navigation;
auto* navView = new NavigationView(this);
navView->setMinimumWidth(440);
navView->setMaximumWidth(620);
navView->setFixedHeight(340);
navView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
navView->setDisplayMode(NavigationView::DisplayMode::Left);
navView->setExpandedPaneWidth(180);
navView->setHeaderChromeWidget(headerSection);
navView->setMainChromeWidget(mainSection);
navView->setFooterChromeWidget(footerSection);
populateNavigationPages(navView->contentHost());
auto routeToPage = [host = navView->contentHost()](int pageIndex) {
const int direction = pageIndex >= host->currentIndex() ? 1 : -1;
host->setCurrentIndex(pageIndex, direction, true);
};
headerSection->onActivated = routeToPage;
mainSection->onActivated = routeToPage;
footerSection->onActivated = routeToPage;import fluentqt
from PySide6.QtWidgets import QSizePolicy
nav = fluentqt.NavigationView()
nav.setMinimumWidth(440)
nav.setMaximumWidth(620)
nav.setFixedHeight(340)
nav.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
nav.setDisplayMode(fluentqt.NavigationView.DisplayMode.Left)
nav.setExpandedPaneWidth(180)
nav.setHeaderChromeWidget(header_section)
nav.setMainChromeWidget(main_section)
nav.setFooterChromeWidget(footer_section)
populate_navigation_pages(nav.contentHost())
def route_to_page(page_index):
host = nav.contentHost()
direction = 1 if page_index >= host.currentIndex() else -1
host.setCurrentIndex(page_index, direction, True)
header_section.on_activated = route_to_page
main_section.on_activated = route_to_page
footer_section.on_activated = route_to_pageAPI
DéclarationAucun membre d'API correspondant.