ListView: text disappears when scrolling (delegate is text over image)



  • Hi,
    I have ListView with simple delegate of text over Image:
    Image
    {
    width: 200
    height: 100
    source: backend.imageList[ model.id]
    Row
    {
    width: parent.width
    height: 40
    spacing: 2

       Text
        {
            width: 100
            height: 40
            horizontalAlignment: Qt.AlignHCenter
            verticalAlignment: Qt.AlignVCenter
            text: model.id
        }
    
        Text
        {
            width: 100
            height: 40
            elide: Qt.ElideMiddle
            horizontalAlignment: Qt.AlignHCenter
            verticalAlignment: Qt.AlignVCenter
            text: "Fixed text 2"
        }
    

    }

    When i perform scrolling: the text surprisingly disappeared on some y positions.
    The effect happens everytime with specific image.
    Changing the Image with Rectangle fix the problem.

    Platform: both Linux and Windows.

    Any help would be appreciated.



  • Hi

    probably you adding elements to your model not in GUI thread?



  • @vladstelmahovsky
    No, the model which i use lives within main GUI thread.


  • Moderators

    Hi,
    I experienced this, too, when putting Text over a Rectangle with round corners.



  • My problem is image delegate only.

    I found addiotional regularity: problematic delegates have the same picture as last top delegate hidden during scroll down within ListView.
    It seems scrolling out delegate from visible area forces it's image repaint in other delegates, which are in visible area.

    This repaint seems to hide the text element, declered with z-order above the image.
    Reset the visible property (visible=false, visible=true) at end of each scrolling (using onMovementEneded) solves the problem.
    But, i don't want to pay the repaint price of such solution as my application is running on embedded device.



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.