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

Compiler warns about signal for properties starting with "on"

    XMLWordPrintable

Details

    • 6aed5f4fb (dev), e3e84b2fb (6.5)

    Description

      Despite the fact that using properties starting with "on" might not be very wise, it is not forbidden and correctly handled during runtime.

      Compiler and runtime seem to disagree about signal vs property when interpreting

      import QtQuick
      
      Window {
          id: root
          width: 640
          height: 480
          visible: true
          title: "Foo"
      
          Switch {
              onLabel: qsTr("Power on")
          }
      }
      

      , though. The compiler claims

      Warning: main.qml:11:9: no matching signal found for handler "onLabel" [unqualified]
              onLabel: qsTr("Power on")
              ^^^^^^^

      , but the signal would be have been named onOnLabel instead.

      Attachments

        1. untitled.tgz
          1.0 kB
          Cajus Pollmeier
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ulherman Ulf Hermann
            cajus Cajus Pollmeier
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes