Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Swipe View showing more than one page
Forum Updated to NodeBB v4.3 + New Features

Swipe View showing more than one page

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 715 Views
  • 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.
  • T Offline
    T Offline
    Traust
    wrote on last edited by
    #1

    Hi, I'm trying to create SwipeView that doesn't fill whole windown and when I create it inside Rectangle that isn't size of the window, previous and next site is also visible and I have no idea why it's happening.

    4ced7347-6a0d-45aa-96f8-18bc673d1202-image.png

    import QtQuick 2.14
    import QtQuick.Window 2.14
    import QtQuick.Controls 2.14
    
    Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
    
        Rectangle{
            id: rectId
            anchors.centerIn: parent
            width: 200
            height: 480
    
    
    
            SwipeView {
                    id: view
                    anchors.fill: parent
                    currentIndex: 1
    
                    Component.onCompleted: forceActiveFocus()
                    Rectangle {
                        color: "red"
                        width: 200
                        height: 400
                    }
                    Rectangle {
                        color: "green"
                        width: 200
                        height: 400
                    }
                    Rectangle {
                        color: "blue"
                        width: 200
                        height: 400
                    }
                }
    
            PageIndicator {
                id: indicator
    
                count: view.count
                currentIndex: view.currentIndex
    
                anchors.bottom: view.bottom
                anchors.horizontalCenter: parent.horizontalCenter
            }
        }
    
    }
    
    1 Reply Last reply
    0
    • T Offline
      T Offline
      Traust
      wrote on last edited by
      #2

      I've found solutionlink text

      15c1aef5-8a4f-4c7b-848e-6d0d4d98a9fb-image.png

      1 Reply Last reply
      1

      • Login

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