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

qmltc/qmllint issues with size value type

XMLWordPrintable

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

      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"); 
      ...

       

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes