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

qmllint: default property

    XMLWordPrintable

Details

    • 4ae701226 (dev), 3dec3fc10 (6.9), 4a4299c4f (6.8), b1bd66155 (tqtc/lts-6.5)

    Description

      We force qmllint on our files and tried it with Qt 6.9 beta 1 now. So run in some new warnings but it seems that this is a false positive warning. We stripped down to a little example.

      Of course a Column in a ColumnLayout isn't the best but it is just compatbility layer for us and shows the problem with the default property.

      Warning: main.qml:8:14: Detected width on an item that is managed by a layout. This is undefined behavior; use implicitWidth or Layout.preferredWidth instead. [Quick.layout-positioning]
            width: parent.width
      
      import QtQuick
      import QtQuick.Layouts
      
      GPane {
      	Layout.alignment: Qt.AlignHCenter
      
      	Text {
      		width: parent.width
      	}
      }
      
      import QtQuick
      import QtQuick.Layouts
      
      ColumnLayout {
      	default property alias paneData: content.data
      
      	Column {
      		id: content
      	}
      }
      

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            misery André Klitzing
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes