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

Incorrect layout using Row.layoutDirection

    XMLWordPrintable

Details

    • 1f38d41854fa2daa51d938a4eb398752b1751e0b

    Description

      Run the code below. Note that the blue rectangle and the text are both
      inside the pink rectangle. Comment in the "layoutDirection: Qt.RightToLeft"
      line and run again. Note how the blue rect and text are now all drawn left
      of the pink rect. Expected result is text left of blue rect, both inside
      the pink rect.

      import QtQuick 1.1
      
      Item {
          width: 640
          height: 480
      
          Item {
              anchors.centerIn: parent
              width: row.implicitWidth
              height: row.implicitHeight
      
              Row {
                  id: row
                  spacing: 10
                  anchors.fill: parent
      //            layoutDirection: Qt.RightToLeft
      
                  Rectangle { color: "blue"; width: 32; height: 32 }
      
                  Text {
                      text: "text label";
                      font.pixelSize: 20
                  }
              }
              Rectangle {
                  color: "red"; opacity: 0.2;
                  anchors.fill: row
                  anchors.topMargin: -5
                  anchors.bottomMargin: -5
              }
          }
      }
      

      Attachments

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

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            mathiasm Mathias Malmqvist
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes