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

qmllint doesn't see signal handlers

XMLWordPrintable

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

      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);
      ^^^^^^^^^^^^^^^^

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

            qtqmlteam Qt Qml Team User
            jgill Jarret Gill
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes