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

TextArea's implicitHeight inconsistent

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.4.0
    • 5.2.1
    • Quick: Controls 1
    • None
    • Ubuntu 13.10, Qt 5.2.1

    Description

      TextArea's implicitHeight is inconsistent since it is not adjusted with it's content whereas TextEdit's implicitHeight can be used to set the box size to the content size.

      import QtQuick 2.2
      import QtQuick.Controls 1.1
      
      Rectangle {
          width: 640
          height: 500
          color: "gray"
      
          Row {
              anchors.fill: parent
              anchors.margins: 20
              spacing: 20
      
              Column {
                  id: columnLeft
                  spacing: 5
                  width: 250
      
                  TextArea {
                      text: "One Liner"
                      anchors.left: parent.left
                      anchors.right: parent.right
                      height: implicitHeight
                  }
      
                  TextArea {
                      text: "Two Lines\nof Text"
                      anchors.left: parent.left
                      anchors.right: parent.right
                      height: implicitHeight
                  }
      
                  TextArea {
                      text: "Massive\n\nMulti-\nLine-\nText"
                      anchors.left: parent.left
                      anchors.right: parent.right
                      height: implicitHeight
                  }
              }
      
              Column {
                  id: columnRight
                  spacing: 5
                  width: 250
      
                  TextEdit {
                      text: "One Liner"
                      anchors.left: parent.left
                      anchors.right: parent.right
                      height: implicitHeight
                      selectByMouse: true
                  }
      
                  TextEdit {
                      text: "Two Lines\nof Text"
                      anchors.left: parent.left
                      anchors.right: parent.right
                      height: implicitHeight
                      selectByMouse: true
                  }
      
                  TextEdit {
                      text: "Massive\n\nMulti-\nLine-\nText"
                      anchors.left: parent.left
                      anchors.right: parent.right
                      height: implicitHeight
                      selectByMouse: true
                  }
              }
          }
      }
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            webmaster128 Simon Warta
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes