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

TextInput/TextEdit not de-focused when !enabled

XMLWordPrintable

      Run the code below. Click on the text to focus it (note that the
      background turns green). Press anywhere outside (on the white) to
      set the TextEdit.enabled to false. This should result in the TextEdit
      loosing focus (cursor disappearing) and the background turning red,
      but it doesn't.

      import QtQuick 2.0
      
      Rectangle {
          width: 300; height: 400
      
          MouseArea {
              id: mouseArea
              anchors.fill: parent
          }
      
          TextEdit {
              id: textEdit
              anchors.centerIn: parent
      
              enabled: !mouseArea.pressed
      
              text: "Press mouse button\noutside to !focus"
              font.bold: true
      
              Rectangle {
                  anchors.fill: parent
                  z: -1
                  color: parent.activeFocus ? "green" : "red"
              }
          }
      }
      

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

            denexter Andrew den Exter (closed Nokia identity) (Inactive)
            mathiasm Mathias Malmqvist
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes