Uploaded image for project: 'Qt for MCUs'
  1. Qt for MCUs
  2. QTMCU-351

SwipeView.contentItem behaves differently compared to Qt

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • Qt for MCUs 2.5.4, Qt for MCUs 2.8.1
    • QUL Team
    • None

    Description

      In Qt for MCUs if you set the contentItem to a Flickable (as is required), the "movingHorizontally" property will be "false" as you release the touch and let the swipe view snap into place, even as the animation is ongoing.

      In Qt, "view.contentItem.movingHorizontally" will be true throughout the animation.

      Setting contentItem to an empty Flickable as in Qt for MCUs will also fail to work with the regular Qt.

      If this is intended, it should maybe be documented here:

      https://doc.qt.io/QtForMCUs-2.8/qtul-qtquick-controls-api-differences.html

      import QtQuick 2.15
      import QtQuick.Controls
      
      Rectangle {
          width: 800
          height: 480
      
          SwipeView {
              id: view
              anchors.fill: parent
      
              // comment out this part when using the regular Qt
              contentItem: Flickable {
                  id: flickable
              }
      
              Rectangle {
                  width: 200
                  height: 100
                  Text {
                      anchors.centerIn: parent
                      text: "First"
                  }
              }
      
              Rectangle {
                  width: 200
                  height: 100
                  Text {
                      anchors.centerIn: parent
                      text: "Second"
                  }
              }
      
              Rectangle {
                  width: 200
                  height: 100
                  Text {
                      anchors.centerIn: parent
                      text: "Third"
                  }
              }
          }
      
          Text {
              font.pixelSize: 24
              anchors.bottom: parent.bottom
              anchors.horizontalCenter: parent.horizontalCenter
               // replace this with view.contentItem.movingHorizontally when using the regular Qt
              text: flickable.movingHorizontally ? "<->" : "..."
          }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            srodal Samuel Rødal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes