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

TextInput not reacting to text color change

    XMLWordPrintable

Details

    Description

      Run the code below. Press anywhere on the screen to change the
      Rectangle's "enabled" property to false. This should result in the
      rectangle turning red and the text turning gray, but the latter
      does not happen. Replacing the TextInput with a TextEdit yields
      the expected result, so this is an issue with TextInput specifically.

      import QtQuick 2.0
      Rectangle {
          width: 300; height: 400
      
          Rectangle {
              width: 250; height: 25
              anchors.centerIn: parent
              color: enabled ? "green" : "red"
              enabled: !mouseArea.pressed
      
      //      TextEdit {     // works
              TextInput {      // doesn't work
                  anchors.centerIn: parent
                  text: "Press mouse button to !enable"
                  font.bold: true
                  color: enabled ? "black" : "gray"
              }
          }
      
          MouseArea {
              id: mouseArea
              anchors.fill: parent
          }
      }
      

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes