PageIndicator QML Type

現在アクティブなページを示す。もっと見る...

Import Statement: import QtQuick.Controls
Inherits:

Control

プロパティ

詳細説明

PageIndicatorは、複数のページからなるコンテナの中で、現在アクティブなページを示すために使用される。PageIndicator は、ページを提示するデリゲート項目で構成されます。

Column {
    StackLayout {
        id: stackLayout

        Page {
            // ...
        }
        Page {
            // ...
        }
        Page {
            // ...
        }
    }

    PageIndicator {
        currentIndex: stackLayout.currentIndex
        count: stackLayout.count
    }
}

SwipeViewPageIndicatorのカスタマイズインジケータ・コントロールも参照してください

プロパティ ドキュメント

count : int

このプロパティは、ページ数を保持します。


currentIndex : int

このプロパティは、現在のページのインデックスを保持します。


delegate : Component

このプロパティは、ページを提示するデリゲートを保持します。

以下のプロパティは、各デリゲートのコンテキストで利用可能です:

index: intアイテムのインデックス。
pressed: bool項目が押されたかどうか。

interactive : bool

このプロパティは、コントロールがインタラクティブかどうかを保持します。インタラクティブなページ・インジケータは、押されたことに反応し、自動的にcurrent index を適切に変更します。

SwipeView {
    id: view
    currentIndex: pageIndicator.currentIndex
    anchors.fill: parent

    Page {
        title: qsTr("Home")
    }
    Page {
        title: qsTr("Discover")
    }
    Page {
        title: qsTr("Activity")
    }
}

PageIndicator {
    id: pageIndicator
    interactive: true
    count: view.count
    currentIndex: view.currentIndex

    anchors.bottom: parent.bottom
    anchors.horizontalCenter: parent.horizontalCenter
}

注意: ページ・インジケータは通常、(ユーザー・インターフェースの実際の内容からユーザーの注意をそらすことを避けるために)非常に小さい。また、クリックしにくく、ユーザーがインタラクティブであることを認識しにくいかもしれません。これらの理由から、ナビゲーションの主要な方法(SwipeView など)を補完するために使用するのが最適であり、ナビゲーションを置き換えるものではありません。

デフォルト値はfalse です。


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.