Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. SwipeView issues or go PathView
Qt 6.12 LTS is out! See what's new in the release blog

SwipeView issues or go PathView

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 258 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Deedss
    wrote on last edited by
    #1

    Hello,

    In my application I can swipe through a few mainpages until it reaches the last one. I would like to be able to go back to the first page when I swipe beyond the last one. I've read some things about using a PageView but can't seem to figure it out. Anyone who can help me get started? Do I make a listModel or just add the pages fully in the PathView or something like that?

        SwipeView {
            id: swipeView
            objectName: "swipeView"
    
            currentIndex: 1
            anchors.fill: parent
    
            MainPage {
                objectName: "mainPage"
            }
            MainPage2 {
                objectName: "mainPage2"
            }
            MainPage3 {
                objectName: "mainPage3"
            }
            MainPage4 {
                objectName: "mainPage4"
            }
    //        MainPage5 {
    //            objectName: "mainPage5"
    //        }
    //        Item {
    //            objectName: "page 6"
    //        }
    
            onCurrentIndexChanged: {
                indicatorVisible = true;
                mainPages.state = currentItem.objectName
             }
        }
    
        PageIndicator {
            id: indicator
    
            count: swipeView.count
            currentIndex: swipeView.currentIndex
    
            anchors.top: swipeView.top
            anchors.horizontalCenter: parent.horizontalCenter
    
            delegate: Rectangle {
                implicitWidth: 8
                implicitHeight: 8
    
                radius: width / 2
                color: "white"
    
                opacity: index === swipeView.currentIndex ? 1.0 : 0.35
            }
        }
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt
    • Unsolved