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

Assert when changing focus fast of qquickmaterialplaceholdertext

XMLWordPrintable

    • Windows
    • 560fe5a9f (dev), cde4ab20c (6.7), bfa91e3ad (6.6)

      We ran into this bug during our upgrade from 6.4.2 to 6.6.0.  This is when the animation of the placeholder text is still running:

      66focusanimationbug.zip

      qtcreator_EhE6V3vmCk.mp4

      ---------------------------
      Microsoft Visual C++ Runtime Library
      ---------------------------
      Debug Error!

      Program: C:\Qt\6.6.0\msvc2019_64\bin\Qt6Cored.dll
      Module: 6.6.0
      File: C:\Users\qt\work\qt\qtdeclarative\src\quickcontrols\material\impl\qquickmaterialplaceholdertext.cpp
      Line: 220

      ASSERT: "!m_focusInAnimation" in file C:\Users\qt\work\qt\qtdeclarative\src\quickcontrols\material\impl\qquickmaterialplaceholdertext.cpp, line 220

      (Press Retry to debug the application)

      ---------------------------
      Abort   Retry   Ignore   
      ---------------------------

      Main.qml from the attached example:

      import QtQuick
      import QtQuick.Controls.Material
      
      ApplicationWindow {
          id: window
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
          property var textField
      
          Component.onCompleted: {
              sv.push(mainView)
          }
      
          FocusScope {
              id: root
              anchors.fill: parent
              Button {
                  id: btn
                  anchors.right: parent.right
                  text: focus ? "focus" : "no focus"
              }
      
              Keys.onEscapePressed: function (event) {
                  print("onEscapePressed")
                  event.accepted = true
                  btn.forceActiveFocus()
                  print("forceActiveFocus 1")
                  textField.forceActiveFocus()
                  print("pop")
                  sv.pop()
              }
      
              StackView {
                  id: sv
                  anchors.fill: parent
                  initialItem: empty
              }
              Component {
                  id: empty
                  Rectangle {
                      color: "orange"
                  }
              }
      
              Component {
                  id: mainView
      
                  TextField {
                      id: tf1
                      placeholderText: "placeholderText"
                      Component.onCompleted: window.textField = this
                  }
              }
          }
      }
      

        For Gerrit Dashboard: QTBUG-118889
        # Subject Branch Project Status CR V

            mitch_curtis Mitch Curtis
            kelteseth Elias Steurer
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes