Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    Unsolved ListView and scrollable TextArea refreshing problems

    QML and Qt Quick
    listview textarea scrollview
    1
    1
    94
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      RickS last edited by

      I have a problem when using a scrollable TextArea into a big ListView.

      In the example below, I use a ListView with 12 items. The delegate contains a scrollable TextArea. Since the text is wide/long enough, the TextArea vertical and horizontal scroll bars are enabled in all the TextAreas.

      The problem is, when I scroll the ListView, the TextArea contents start to disappear. Some of them, previously visible, also disappear. Only if I click in one of the TextAreas that has invisible text, then the text (re)appears.

      It does not happen if the text for example is not wide and only the vertical scrollbar is needed.

      In the screenshot below, all the TextAreas should display the same text.

      qml-textarea-problem-01.png

      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtQuick.Controls 2.15
      
      Window {
          id: windowId
          width: 640
          height: 480
          visible: true
      
          ListView {
              anchors.fill: parent
              model: 12
              delegate: Rectangle {
                  width: windowId.width
                  height: 100
                  border.color: "blue"
                  Column {
                      id: column
                      anchors.fill: parent
                      ScrollView {
                          id: view
                          width: column.width/2
                          height: column.height
                          TextArea {
                              text: "TextArea\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA..\nBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB..\nC..\nD..\nE..\nF..\nG..\nH..\nI..\nJ..\nK..\nL..\nM..\nN..\nO..\nP..\nQ..\nR..\nS..\nT..\nU..\nV..\nW..\nX..\nY..\n"
                          }
                      }
                  }
              }
          }
      

      I'm using Qt 5.15.2 MSVC 2019 64 bits in Windows 10.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post