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

in debug mode reference errors in QML Connections

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Not Evaluated
    • Resolution: Duplicate
    • 5.12.3
    • 5.12.4
    • None
    • MSVC2017 64x, Win10, Qt 5.12.3, QtCreator 4.9.1
    • Windows
    • 4fea3ec29c9911522a379a01418394b5cad29ecc (qt/qtdeclarative/5.12)

    Description

      Hello. When I run the next code in debug mode, I got qrc:/main.qml:31: ReferenceError: value is not defined. It seems that in release mode does not always work.

      Quick solutions: onTest: function(value) or onTest: foo(value)

      import QtQuick 2.12
      import QtQuick.Window 2.12
      
      Window {
          visible: true
          width: 640
          height: 480
      
          Rectangle {
              id: tra
              anchors.fill: parent
              color: "red"
      
              signal test(int value);
      
              MouseArea {
                  anchors.fill: parent
      
                  onClicked: {
                      tra.test(1);
                  }
              }
          }
      
          Connections {
              target: tra
              enabled: true
              ignoreUnknownSignals: true
      
              onTest: {
                  console.log("Value: " + value);
              }
          }
      }
      
      

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              andrask andrask
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes