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

Repeater or GridLayout have problem with external property

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.9.4
    • Quick: Layouts
    • None

    Description

      • start example
      • see working GridLayout
      • increase or decrease
      • see bugged GridLayout
        • if you change width and height with Layout stuff -> it works
        • if you hard code width and height -> it works

       

       

      import QtQuick 2.6
      import QtQuick.Layouts 1.3
      import QtQuick.Controls 2.2
      import QtQuick.Window 2.0
      
      ApplicationWindow {
          id: mainWindow
          visible: true
      
          property int baseSize: 20
      
          Component.onCompleted: app.quickLoadGame();
          RowLayout {
              Button { text: "+"; onClicked: repeater.model += 1; }
              Text   { text: repeater.model; }
              Button { text: "-"; onClicked: repeater.model -= 1; }
      
              GridLayout {
                  columns: 8
      
                  Repeater {
                      id: repeater
                      model: 16
      
                      Rectangle {
                          color:  "red"
                          width:  baseSize
                          height: baseSize
                          // Layout.preferredWidth: baseSize
                          // Layout.preferredHeight: baseSize
      
                          Text { anchors.fill: parent; text: index; }
                      }
                  }
              }
          }
      }

      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
            garaone garaone
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes