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: text disappears when scrolling (delegate is text over image)

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

Scheduled Pinned Locked Moved QML and Qt Quick
listviewtext renderingtextimage
5 Posts 3 Posters 3.2k 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.
  • A Offline
    A Offline
    alexein1983
    wrote on 28 May 2015, 13:58 last edited by alexein1983
    #1

    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.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vladstelmahovsky
      wrote on 28 May 2015, 15:22 last edited by
      #2

      Hi

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

      A 1 Reply Last reply 31 May 2015, 07:15
      0
      • V vladstelmahovsky
        28 May 2015, 15:22

        Hi

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

        A Offline
        A Offline
        alexein1983
        wrote on 31 May 2015, 07:15 last edited by alexein1983
        #3

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

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on 31 May 2015, 08:24 last edited by
          #4

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

          A 1 Reply Last reply 31 May 2015, 12:34
          0
          • ? A Former User
            31 May 2015, 08:24

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

            A Offline
            A Offline
            alexein1983
            wrote on 31 May 2015, 12:34 last edited by alexein1983
            #5

            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.

            1 Reply Last reply
            0

            1/5

            28 May 2015, 13:58

            • Login

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