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

qmllint doesn't see signal handlers

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.9
    • 6.5.0
    • QML: Tooling
    • None

    Description

      Trying to connect to signal handlers through javascript code generates confusing warnings that the signal handler doesn't exist, even when explicitly specifying the type using 'as':

      function foo() {}

      Loader {
      id: loader
         sourceComponent: Item
          onLoaded:

      {        (loader.item as Item).onVisibleChanged.connect(foo);    }

      }

      This generates the following qmllint warnings:

      Warning: main.qml:33:25: Member "onVisibleChanged" not found on type "QQuickItem" [missing-property]
      (loader.item as Item).onVisibleChanged.connect(foo);
      ^^^^^^^^^^^^^^^^
      Warning: main.qml:33:25: Could not compile binding for onLoaded: Cannot load property onVisibleChanged from QQuickItem of QQuickItem. [compiler]
      (loader.item as Item).onVisibleChanged.connect(foo);
      ^^^^^^^^^^^^^^^^

      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
              jgill Jarret Gill
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes