Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Solved SwipeView shows neighbor pages even if they are not current page

    QML and Qt Quick
    quick controls swipeview
    2
    3
    1468
    Loading More Posts
    • 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.
    • lollypolly
      lollypolly last edited by

      Hello. I am trying to use SwipeView as area for image previews, everything works as expected, but SwipeView shows neighbor page even if that page is not active page, here is screenshot. So, code for SwipeView:

          SwipeView {
              background: Rectangle {
                  anchors.fill: parent
                  color: "lightsteelblue"
              }
              id: previews
              anchors.top: parent.top; anchors.left: parent.left;
              width: 130
              height: 180
              Repeater {
                  model: imgModel
                  Image {
                      fillMode: Image.PreserveAspectFit
                      source: src
                  }
              }
          }
      

      As far as you can see, it is limited to 130x180. Anyone know how to fix this?

      1 Reply Last reply Reply Quote 0
      • jpnurmi
        jpnurmi last edited by

        SwipeView does not clip by default. You can set clip: true in cases when it is needed.

        http://doc.qt.io/qt-5/qtquick-performance.html#clipping

        1 Reply Last reply Reply Quote 2
        • lollypolly
          lollypolly last edited by

          @jpnurmi, thanks a lot, already found this property. But had limit in 300 seconds to reply. Seems like u are guru of QML :)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post