Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTreeView and node's expanding
Qt 6.11 is out! See what's new in the release blog

QTreeView and node's expanding

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.1k 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.
  • A Offline
    A Offline
    aliks-os
    wrote on last edited by
    #1

    I have a custom model and a tree inherited from QTreeView. After a loading of data I need expand some nodes. I do it from mainWidget as

    treeView.expand(index)
    

    Work fine. But volume of data grows and iterate all tree take a time. Now I am looking for how insert function of expanding to a treeView or delegate. I mean when the treeView start loading a data from model, the node will expanded or not depends of property of item.
    somethig like

    some event(QModelIndex index) {
       Item *item = index.internalPointer();
       if (item.flag() == 2)
          this->expand(index);
    }
    

    Could anybody direct me what even/slot/function/solution I could use in QTreeView. This function I need just at the start of application. I mean when treeView->setModel(model) is occur

    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