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. Issue with QTreeView, sub tree items are not getting loaded

Issue with QTreeView, sub tree items are not getting loaded

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 206 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.
  • DonCoderD Offline
    DonCoderD Offline
    DonCoder
    wrote on last edited by aha_1980
    #1
    This post is deleted!
    1 Reply Last reply
    0
    • DonCoderD Offline
      DonCoderD Offline
      DonCoder
      wrote on last edited by DonCoder
      #2

      Issue resolved. The culprit is ```
      QModelIndex TaskModel::parent(const QModelIndex &child) const
      {
      if(child.isValid())
      {
      Task subTask = static_cast<Task>(child.internalPointer());
      Task *parent = subTask->parentTask();
      if(!(parent == rootTask))
      {
      return createIndex(parent->row(),0,subTask); // Wrong
      return createIndex(parent->row(),0,parent ); // Right
      }
      }

      return QModelIndex();
      

      }

      1 Reply Last reply
      1

      • Login

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