IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

PageIndicator QML Type

Indicates the currently active page.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

PageIndicator QML Type

  • Import Statement: import QtQuick.Controls

  • Inherits: Control

  • Group: PageIndicator is part of qtquickcontrols-indicators

Detailed Description

PageIndicator is used to indicate the currently active page in a container of multiple pages. PageIndicator consists of delegate items that present pages.

Image non disponible
 
Sélectionnez
Column {
    StackLayout {
        id: stackLayout

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

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

See Also

Property Documentation

 

count : int

This property holds the number of pages.

currentIndex : int

This property holds the index of the current page.

delegate : Component

This property holds a delegate that presents a page.

The following properties are available in the context of each delegate:

index : int

The index of the item

pressed : bool

Whether the item is pressed

interactive : bool

This property holds whether the control is interactive. An interactive page indicator reacts to presses and automatically changes the current index appropriately.

 
Sélectionnez
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
}

Page indicators are typically quite small (in order to avoid distracting the user from the actual content of the user interface). They can be hard to click, and might not be easily recognized as interactive by the user. For these reasons, they are best used to complement primary methods of navigation (such as SwipeView), not replace them.

The default value is false.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+