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

TextArea with ScrollBar

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.12.9, 5.15.0
    • Quick: Controls 2
    • None
    • Windows

    Description

      when using TextArea with ScrollBar,there is a bug.

      the doc suggests us to write code like this:

      ApplicationWindow {
          width: 640
          height: 480
          visible: true
          title: qsTr("Scroll")
          Component.onCompleted: {
              for(var loop=0;loop<1000;++loop)
              {
                  text.append("1234567890");
              }
          }
      
          ScrollView {
              id: view
              anchors.fill: parent
              TextArea {
                  id:text
                       text: "TextArea\n...\n...\n...\n...\n...\n...\n"
                   }
              ScrollBar.vertical: ScrollBar{}
          }
      }
      

      but the above scollbar does not work well.in that case ,there has two scrollbar ,one is at the top left,the other is vertical.but the  top left one can scoll the textarea.the vertical one has nothing effect.in some complicated situation ,there is only one srollbar at top left.

      if you  change code to below:

      ApplicationWindow {
          width: 640
          height: 480
          visible: true
          title: qsTr("Scroll")
          Component.onCompleted: {
              for(var loop=0;loop<1000;++loop)
              {
                  text.append("1234567890");
              }
          }
      
          ScrollView {
              id: view
              anchors.fill: parent
              TextArea {
                  id:text
                       text: "TextArea\n...\n...\n...\n...\n...\n...\n"
                   }
      
          }
          ScrollBar.vertical: ScrollBar{}
      }
      

      then the application output window will display like this:

      qrc:/main.qml:5:1: QML ApplicationWindow: ScrollBar must be attached to a Flickable or ScrollView
      

      but in that case ,there is only one ScollBar at vertical.

      I remeber 5.9 does not has this bug.when I use 5.12  I discover this bug some week ago.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            redcarp redcarp
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes