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

Cannot assign binding of type Button to QQuickItem

    XMLWordPrintable

    Details

    • Commits:
      ffe31b09bbdd4c757748e1fcf87730ac5888f731 (qt/qtdeclarative/dev)

      Description

      For some reason "qmllint" (qtdeclarative 3e95a57dc1fb39b059b52e16fcce7b4262f88b61) can not understand that "Button" inherits from "Item".

      For such code:

      import QtQuick 2.11
      import QtQuick.Controls 2.4
      import QtQuick.Window 2.3
      
      Button {
          Image {
              anchors.centerIn: parent
          }
      }
      

      "qmllint" reports warning, while "qml" execute this code without any problem.

      > qmllint --compiler=warning Test.qml
      Warning: Test.qml:7:27: Cannot assign binding of type Button to QQuickItem
              anchors.centerIn: parent
                                ^^^^^^
      Warning: Test.qml:7:33: Could not compile binding for centerIn: cannot convert from QQuickButton of ??::parent with type QQuickItem to QQuickItem of QQuickItem
          }
      }
      

        Attachments

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

          Activity

            People

            Assignee:
            ulherman Ulf Hermann
            Reporter:
            evgeniy_dushistov evgeniy_dushistov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes