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

QQuickCanvas asserts on application exit if nested focus scope is cleared in onActiveFocusChanged handler

    XMLWordPrintable

Details

    Description

      QQuickCanvasPrivate::clearFocusInScope asserts when the following "application" is closed

      import QtQuick 2.0
      
      Rectangle {
          width: 200
          height: 200
      
          FocusScope {
              id: focusScope
              anchors.fill: parent
      
              TextInput {
                  anchors.centerIn: parent
                  text: "Some text"
                  onActiveFocusChanged: if (!activeFocus) focusScope.focus = false
                  Component.onCompleted: forceActiveFocus()
              }
          }
      }
      

      The assert happens on this line:

      Q_ASSERT(item == rootItem || item == scopePrivate->subFocusItem);

      "scopePrivate->subFocusItem" is already null at this point.

      Attachments

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

        Activity

          People

            aalpert-nokia Alan Alpert (closed Nokia identity) (Inactive)
            skananoj Sami Kananoja
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes