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. Render only visible items.
Forum Updated to NodeBB v4.3 + New Features

Render only visible items.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 944 Views 1 Watching
  • 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.
  • K Offline
    K Offline
    KrabQT
    wrote on last edited by
    #1

    If i have for example ListView with thousands items, i don't want them all to be processed, because it will hurts perfromance.
    I read that i could setup the visible property to false, but i would better do something similiar to when using QPainter to paint items.
    With QPainter if i know that widget height is 100 and i have 1000 items where each has 10px, i can easily to calculate which items to paint based on where scrollbar is, so it is very fast. How to do this in Qt Quick 2? Actually i don't want even to use that QML (i don't want the javascript engine to slow down the app), i wanna to use C++ for everything. I expect some method where i can add to Scene Graphs just items that are visible (which i will calculate based on height etc..), but can't find where to do it.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      KrabQT
      wrote on last edited by KrabQT
      #2

      As i went through source code of qdeclarative, i noticed that it is even not possible to add for example text node programatically, so i think best way for me will be to fork qdeclarative so i can use even those private classes and do what i need.

      p3c0P 1 Reply Last reply
      0
      • K KrabQT

        As i went through source code of qdeclarative, i noticed that it is even not possible to add for example text node programatically, so i think best way for me will be to fork qdeclarative so i can use even those private classes and do what i need.

        p3c0P Offline
        p3c0P Offline
        p3c0
        Moderators
        wrote on last edited by
        #3

        @KrabQT Sounds like a good opportunity for QAbstractItemModel with ListView. Re-Implement fetchMore and canFetchMore for incremental model.

        157

        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