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

QML: mapFromItem crashes on ListView item's parent

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.8.x
    • 4.8.0
    • None
    • Windows 7 - 64 Bit, Qt 4.8.0 for Desktop - MinGW.
    • bec02b3f36b7e266b00bb143c459cacabda69b69

    Description

      When the function mapFromItem is invoked on a ListView's list item's parent, the application crashes. The same QML code works, when A.mapFromItem(B, x, y) is replaced by B.mapToItem(A, x, y).

      Sample code:

      Crash.qml
      import QtQuick 1.1
      
      Rectangle {
          id: root
      
          ListView {
              anchors.fill: parent
              model: 1
              delegate: Rectangle {
                  id: rect
                  Component.onCompleted: {
                      rect.parent.mapFromItem(root, 0, 0); // <== CRASH
                      //root.parent.mapToItem(rect, 0, 0); // <== WORKS!
                  }
              }
          }
      }
      

      Attachments

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

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            mario.winterer Mario Winterer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes