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

qmltc/qmllint issues with size value type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.7
    • 6.5.3
    • QML: Compiler
    • None
    • All

    Description

      For the example below:

       

      import QtQuick
      
      Item {
          id: _control
      
          implicitWidth: 640
          implicitHeight: 480
      
          property size leftIconSize: "150x50"
      
          Image {
              sourceSize: _control.leftIconSize
          }
      }

      qmllint reports warnings (how to resolve them?):

      Warning: MyComponent.qml:12:21: Cannot assign binding of type QSizeF to QSize [incompatible-type]
              sourceSize: _control.leftIconSize
                          ^^^^^^^^^^^^^^^^^^^^^
      Warning: MyComponent.qml:12:42: Could not compile binding for sourceSize: cannot convert from QSizeF of (component in MyComponent.qml)::leftIconSize with type QSizeF to QSize of QSize [compiler] 

      qmltc generates incorrect code:

      ...
      this->m_leftIconSize = QStringLiteral("150x50"); 
      ...

       

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              maksimshapovalov Maksim Shapovalov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes