Fluent-Qt

ナビゲーション

NavigationView ナビゲーションビュー

トップレベルナビゲーション用の適応型左ペインとコンテンツ領域を提供します。

サンプル

NavigationView ナビゲーションビュー: クロームスロット

使い方

クロームスロット

ヘッダー、メイン、フッターのクロームは呼び出し側が所有するウィジェットで、NavigationView はシェルジオメトリの割り当てのみを行います。

#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;

fluent::navigation::NavigationView

継承元 QWidget · FluentElement · QMLPlus

ペイン表示モードとコンテンツホストを備えたアダプティブナビゲーションシェルです。ペインのジオメトリ、上部/側面レイアウトの遷移、コンパクト幅、レスポンシブブレークポイントを管理し、ナビゲーションペインのウィジェットとページは呼び出し側が提供します。

コンストラクタ

デストラクタ

列挙型

enum class DisplayMode
  • Auto
  • Left
  • LeftCompact
  • LeftMinimal
  • Top

メソッド

DisplayMode displayMode() const

レスポンシブ制約が適用される前に要求されたナビゲーションレイアウトモードです。

void setDisplayMode(DisplayMode mode)

レスポンシブ制約が適用される前に要求されたナビゲーションレイアウトモードです。

DisplayMode effectiveDisplayMode() const

レスポンシブ制約が適用された後の表示モード。

bool isPaneOpen() const

ナビゲーションペインが開いているかどうか。

void setPaneOpen(bool open)

ナビゲーションペインが開いているかどうか。

int compactModeThresholdWidth() const

コンパクトナビゲーションモードの幅のしきい値。

void setCompactModeThresholdWidth(int width)

コンパクトナビゲーションモードの幅のしきい値。

int expandedModeThresholdWidth() const

展開ナビゲーションモードの幅のしきい値。

void setExpandedModeThresholdWidth(int width)

展開ナビゲーションモードの幅のしきい値。

int expandedPaneWidth() const

展開モード時のナビゲーションペイン幅。

void setExpandedPaneWidth(int width)

展開モード時のナビゲーションペイン幅。

int compactPaneWidth() const

コンパクトモード時のナビゲーションペイン幅。

void setCompactPaneWidth(int width)

コンパクトモード時のナビゲーションペイン幅。

int topBarHeight() const

上部ナビゲーションバーの高さ(ピクセル単位)です。

void setTopBarHeight(int height)

上部ナビゲーションバーの高さ(ピクセル単位)です。

bool isAnimationEnabled() const

ペインおよびレイアウトモードの切り替えをアニメーション化するかどうか。

void setAnimationEnabled(bool enabled)

ペインおよびレイアウトモードの切り替えをアニメーション化するかどうか。

bool setHeaderChromeWidget(QWidget* widget, WidgetOwnership ownership)

所有権ポリシーを明示してヘッダークロームウィジェットを設定します。

QWidget* takeHeaderChromeWidget()

所有権のクリーンアップを適用せずに、ヘッダークロームウィジェットを切り離して返します。

bool releaseHeaderChromeWidget()

ヘッダークロームウィジェットを削除し、設定された所有権ポリシーを適用します。

bool setMainChromeWidget(QWidget* widget, WidgetOwnership ownership)

所有権ポリシーを明示してメインクロームウィジェットを設定します。

QWidget* takeMainChromeWidget()

所有権のクリーンアップを適用せずに、メインクロームウィジェットを切り離して返します。

bool releaseMainChromeWidget()

メインクロームウィジェットを削除し、設定された所有権ポリシーを適用します。

プロパティ

DisplayMode displayMode

レスポンシブ制約が適用される前に要求されたナビゲーションレイアウトモードです。

読み取り displayMode()書き込み setDisplayMode()通知シグナル displayModeChanged()
DisplayMode effectiveDisplayMode

レスポンシブ制約が適用された後の表示モード。

読み取り effectiveDisplayMode()通知シグナル effectiveDisplayModeChanged()
bool paneOpen

ナビゲーションペインが開いているかどうか。

読み取り isPaneOpen()書き込み setPaneOpen()通知シグナル paneOpenChanged()
int compactModeThresholdWidth

コンパクトナビゲーションモードの幅のしきい値。

読み取り compactModeThresholdWidth()書き込み setCompactModeThresholdWidth()通知シグナル compactModeThresholdWidthChanged()
int expandedModeThresholdWidth

展開ナビゲーションモードの幅のしきい値。

読み取り expandedModeThresholdWidth()書き込み setExpandedModeThresholdWidth()通知シグナル expandedModeThresholdWidthChanged()
int expandedPaneWidth

展開モード時のナビゲーションペイン幅。

読み取り expandedPaneWidth()書き込み setExpandedPaneWidth()通知シグナル expandedPaneWidthChanged()
int compactPaneWidth

コンパクトモード時のナビゲーションペイン幅。

読み取り compactPaneWidth()書き込み setCompactPaneWidth()通知シグナル compactPaneWidthChanged()
int topBarHeight

上部ナビゲーションバーの高さ(ピクセル単位)です。

読み取り topBarHeight()書き込み setTopBarHeight()通知シグナル topBarHeightChanged()
bool animationEnabled

ペインおよびレイアウトモードの切り替えをアニメーション化するかどうか。

読み取り isAnimationEnabled()書き込み setAnimationEnabled()通知シグナル animationEnabledChanged()
qreal layoutTransitionProgress

ナビゲーションレイアウトのトランジションで使用される進行度。

読み取り layoutTransitionProgress()書き込み setLayoutTransitionProgress()

シグナル

void displayModeChanged(DisplayMode mode)

レスポンシブ制約が適用される前に要求されたナビゲーションレイアウトモードです。

void effectiveDisplayModeChanged(DisplayMode mode)

レスポンシブ制約が適用された後の表示モード。

void paneOpenChanged(bool open)

ナビゲーションペインが開いているかどうか。

void compactModeThresholdWidthChanged(int width)

コンパクトナビゲーションモードの幅のしきい値。

void expandedModeThresholdWidthChanged(int width)

展開ナビゲーションモードの幅のしきい値。

void expandedPaneWidthChanged(int width)

展開モード時のナビゲーションペイン幅。

void compactPaneWidthChanged(int width)

コンパクトモード時のナビゲーションペイン幅。

void topBarHeightChanged(int height)

上部ナビゲーションバーの高さ(ピクセル単位)です。

void animationEnabledChanged(bool enabled)

ペインおよびレイアウトモードの切り替えをアニメーション化するかどうか。

PySide6 拡張

protected メンバー

メソッド

fluent::FluentElement から継承

列挙型

enum Theme

デザイントークン解決時に使用されるグローバルな視覚テーマ。

  • Light = 0
  • Dark = 1
  • HighContrast = 2

メソッド

static void setTheme(Theme theme)

グローバルテーマを更新し、アクティブな FluentElement インスタンスに通知します。

static void setThemeDeferred(Theme theme)

現在の操作をブロックせずに、可視要素を優先したバッチ処理でテーマの更新をスケジュールします。

static Theme currentTheme()

現在有効なグローバルテーマを返します。

static bool themeUsesDarkAppearance(Theme theme)

テーマがダークベースのクロームおよびマテリアルトークンを使用するかどうかを返します。

static void refreshTheme()

デザイントークンの変更後に再描画するため、現在のテーマを再ブロードキャストします。

static int themeGeneration()

テーマ変更ごとに加算される単調増加カウンターです。鮮度チェックに使用されます。

Theme effectiveTheme() const

継承された QWidget の上書きを尊重し、この要素が使用するテーマを解決します。

bool effectiveThemeUsesDarkAppearance() const

この要素の有効なテーマがダークベースのクロームを使用するかどうかを返します。

bool setThemeOverrides(const QJsonObject& overrides)

この要素のスパースな色、角丸半径、フォントトークンの上書きを置き換えます。

QJsonObject themeOverrides() const

この要素に設定されたオーバーライドを返します。

void clearThemeOverrides()

すべてのトークンフィールドをグローバルテーマの既定値に復元します。

const Colors& themeColorsRef() const

描画のホットパス向けにアクティブなカラーセットへ非コピーでアクセスします。

Material::AcrylicToken themeAcrylic() const

マテリアル、エレベーション、およびアダプティブレイアウトのトークン。

QColor themeBackdrop(bool active) const

指定されたアクティブ状態に対するウィンドウ chrome の背景色。

virtual void onThemeUpdated()

グローバルテーマの変更後に呼び出されます。

型とエイリアス

struct Colors

コンポーネントに返されるデザイントークンのスナップショット。

fluent::QMLPlus から継承

メソッド

AnchorLayout::Anchors* anchors()

QWidget ホストの変更可能なアンカーを返します。

void setState(const QString& name)

登録済みの状態を名前で適用するか、@p name が空の場合はデフォルト状態を復元します。未知の名前は無視され、その状態を離れると既存のバインディングが再開されます。

void addState(const QMLState& state)

名前付き状態定義を登録または置換します。アクティブな状態を置換した場合は即座に適用されます。

void evaluateStates()

登録順に状態条件を再評価し、最初に一致した状態(一致しない場合はデフォルト状態)をアクティブにします。依存プロパティの変更通知時にも自動実行され、extend を使用する派生状態は、循環や欠損がない限り祖先の変更を継承します。

QMLPlusRuntime* runtime()

このホストが所有し、遅延生成される状態オブザーバーを返します。

void setAnchors(const AnchorLayout::Anchors& anchors)

すべてのホストアンカーを置き換え、親レイアウトを無効化します。

void resetAnchors()

ホストのすべてのアンカーをクリアし、親レイアウトを無効化します。

void bind(const char* targetProp, QObject* source, const char* sourceProp, PropertyBinder::Direction dir = PropertyBinder::OneWay)

PropertyBinder::bind() を介して、@p source の @p sourceProp をこの QWidget ホストの @p targetProp にバインドします。

void addTransition(const StateTransition& transition)

優先順位順に状態遷移を登録します。

void setBehavior(const char* propertyName, const PropertyAnimation& animation)

writeProperty() またはバインディング経由で @p propertyName が書き込まれた際に使用されるデフォルトアニメーションを設定します。明示的な StateTransition ルールが優先され、C++ のセッターを直接呼び出した場合はアニメーションしません。

void clearBehavior(const char* propertyName)

今後のマネージド書き込みに使用するデフォルトアニメーションを削除します。

bool writeProperty(const char* propertyName, const QVariant& value)

バインディングを削除せずに Behavior 経由でホストプロパティに書き込みます。

Qt 基底クラスドキュメント:QWidget