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

Width vs. implicitWidth + Qt.RightToLeft layout direction

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.12, 6.4.2
    • Quick: Layouts
    • None

    Description

      A trouble with Flickable. Finally, I've found the reason and probably this is not a bug. You decide it.

      If I specify Flickable's contentWidth by using its child width property and also use Qt.RightToLeft layout direction for the child, the component displays nothing.

      The code (note the comments!) and screenshots are attached.

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtQuick.Layouts 1.12
      import QtQuick.Controls 2.12
      Window 
      {
          id: root    
          width: 250
          height: 150
          visible: true
          title: qsTr("Hello World")    
      
          Flickable
          {
              contentWidth: all.width // <======= THE CULPRIT #1
              //contentWidth: all.implicitWidth  // <======= this one works absolutely fine even with  Qt.RightToLeft layout direction        
      
              contentHeight: all.implicitHeight + 48        
              implicitWidth: all.implicitWidth + 30
      
              implicitHeight: all.implicitHeight + 48        
      
              RowLayout
              {
                  id: all            
                  anchors.fill: parent            
                  layoutDirection: Qt.RightToLeft // <======= THE CULPRIT #2, in case the CULPRIT #1 is also used.            
                  Rectangle {
                      color: "black"
                      implicitWidth: 100
                      implicitHeight: 100
                  }            
                  Rectangle {
                      color: "red"
                      implicitWidth: 100
                      implicitHeight: 100
                  }
              }
          }
      } 

       

       

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            alervd Alexander Dyagilev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes