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

Setting HoverHandler cursorShape in a Window crashes

    XMLWordPrintable

Details

    • 3e95a57dc1fb39b059b52e16fcce7b4262f88b61 (qt/qtdeclarative/dev) cdc5f8ff81c1d146ea063e31577c06e7327cca27 (qt/qtdeclarative/6.2) 33e24224555efa58736e9724aba19d0fc873b7c1 (qt/tqtc-qtdeclarative/5.15)

    Description

      The following QML code crashes in QQuickPointerHandler::setCursorShape / QQuickItemPrivate::setHasCursorInChild :

      import QtQuick 2.15
      import QtQuick.Window 2.15
      
      Window {
          HoverHandler {
              cursorShape: Qt.ArrowCursor
          }
      }
      

      I guess it's because the HoverHandler is not yet reparented to the Window contentItem and tries to use the Window as a QQuickItem.
      Setting cursorShape in a more "complex" expression doesn't crash, the evaluation of the binding must be delayed after the reparenting. This means you can use this as a workaround:

      cursorShape: (Qt.ArrowCursor)
      

       

      Attachments

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

        Activity

          People

            srutledg Shawn Rutledge
            grecko Pierre-Yves Siret
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes