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

mapToItem: type const QQuickItem for argument 0 cannot be resolved

    XMLWordPrintable

Details

    • Windows

    Description

      This test code:

      import QtQuick
      import QtQuick.Controls.Material
      import QtQuick.Layouts
      
      ApplicationWindow {
          id: window
          width: 640
          height: 480
          visible: true
          title: qsTr("Test")
      
          ColumnLayout {
              id: column
          }
      
          Button {
              id: btn
              text: "Click me"
              onClicked: {
                  var pos = btn.mapToItem(column, 1.0, 1.0);
                  //console.log("Dummy: " + pos);
              }
          }
      }
      

      outputs the following warning:

      [4/7 18.2/sec] Generating .rcc/qmlcache/androtest_main_qml.cpp
      Warning: main.qml:20:27: Could not compile binding for onClicked: No matching override found. Candidates:
      Function expects 5 arguments, but 3 were provided
      Function expects 2 arguments, but 3 were provided
      type const QQuickItem for argument 0 cannot be resolved
      Function expects 2 arguments, but 3 were provided [compiler]
                  var pos = btn.mapToItem(column, 1.0, 1.0);
                                ^^^^^^^^^
      

      Attachments

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

        Activity

          People

            dima.a Dmitrii Akshintsev
            Harald Meyer Harald Meyer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes