Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-140116

SwipeView doesn't resize its items until resized itself.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.15.13, 6.4.2
    • Quick: Controls 2
    • None
    • Ubuntu 24.04.
    • Linux/X11

      When a SwipeView is instantiated, it doesn't resize its items until it is resized itself.

      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtQuick.Controls 2.15
      
      Window {
          visible: true
          width: 640
          height: 480
      
          Button {
              text: "Resize swipeview"
              onClicked: swipeView.height += 1
          }
      
          SwipeView {
              id: swipeView
              x: 195
              y: 133
              width: 200
              height: 200
              interactive: true
      
              Item {
                  Text {
                      id: text1
                      text: qsTr("Hello")                    
                  }
              }
      
              Item {
                  Text {
                      id: text2
                      text: qsTr("Bye")
                  }
              }
          }
      }
      

      Before clicking on "Resize swipeview", the two texts are stacked on top of each others, and the Items have a size of 0.
      After forcing a layout of its content by resizing the SwipeView, both items have a more correct size of 200x201 and 200x202 (I can't explain why its not 200x200 but that's not my focus here).

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            hugal31 Hugo Laloge
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes