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. Why the delegate component is eating up my memory
Forum Updated to NodeBB v4.3 + New Features

Why the delegate component is eating up my memory

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 202 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.
  • P Offline
    P Offline
    pingal
    wrote on last edited by pingal
    #1

    I've created a panel to view users information everytime a user connects. I've noticed that memory leakage occurs everytime a user disconnects so I debugged the whole c++ code to find out what is causing the memory leak. And now I figured out that QML delegate portion is the causing the leak.

    Here is my delegate:

    I've created a delegate like below.

    Component {
            id: itemDelegate
            Row {
               ..
                Rectangle {
                    ...
                    Text {
                        id: name
                        text: modelData.name
                    }
                    MouseArea {
                        anchors.fill: parent
                        onClicked: list.currentIndex = index
                    }
                }
            }
    }
    

    If I replace the Component with Item, leakage stops but then I'm unable to use the above as a delegate.

    Here is the simplified form of my ListView

     ListView {     
                 id: list     
                 model: Wrapper.mypersons
                 delegate: itemDelegate     
                 highlight: Rectangle {..}     
             }
    

    Every time a user info is shown, my memory consumption increase by some ~3-4MBs but when the user is removed from the view, the memory doesn't rollback.

    Any help would be appreciated.

    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