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

Property "hasOwnProperty" not found on type "Item"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Fixed
    • Affects Version/s: 6.3
    • Fix Version/s: 6.3
    • Component/s: QML: Tooling
    • Commits:
      90790ef23bb148b4ac4c055bd3c11153b4c9a502 (qt/qtdeclarative/dev)

      Description

      "qmllint" (qtdeclarative/e9bdafcfad0f09d15b710a3bca5acae2604c14bc) reports:

      Warning: Test.qml:7:14: Property "hasOwnProperty" not found on type "Item"
                      if (myItem.hasOwnProperty('isChecked')) {
                              ^^^^^^^^^^^^^^
      

      for such code:

      import QtQuick 2.15
      
      Item {
              id: myItem
      
              Component.onCompleted: {
                      if (myItem.hasOwnProperty('isChecked')) {
                              console.log(true);
                      } else {
                              console.log(false);
                      }
              }
      }
      

      "qml" executes such code just fine.

        Attachments

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

          Activity

            People

            Assignee:
            max.goldstein Maximilian Goldstein
            Reporter:
            evgeniy_dushistov evgeniy_dushistov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes