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

Initial Linecount in TextArea shows wrong value

    XMLWordPrintable

Details

    • qtdeclarative/stable: afc10fe7bbe683d4107cc6439c783b4604320414

    Description

      Run the below code,

      
          import QtQuick 2.1
          import QtQuick.Controls 1.0
           
          ApplicationWindow {
              width: 480; height : 800
           
              TextArea{
                  id: tA1
                  anchors{top:parent.top; left:parent.left; right:parent.right; margins: 40}
                  text:"This is a Sample Text Area One which contains some Text"
                  height: 40 +  lineCount*18  //this could be used to make the textarea grow if the text does
              }
              Label{
                  anchors{bottom: parent.bottom;bottomMargin: 40; horizontalCenter: parent.horizontalCenter}
                  width: 100; height: 40
                  text:"LineCount :: " +tA1.lineCount
              }
          }
      
      
      

      At the beginning the linecount shows 11, and after an update in TextArea, it shows correct value.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            tapadar Indrajit Tapadar (Inactive)
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes