Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. ListView and scrollable TextArea refreshing problems

ListView and scrollable TextArea refreshing problems

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
listviewtextareascrollview
1 Posts 1 Posters 380 Views
  • 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 Offline
    R Offline
    RickS
    wrote on last edited by
    #1

    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
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved