Results 1 to 2 of 2

Thread: QTreeView and expanding items just added

  1. #1
    Join Date
    Sep 2009
    Location
    Poland, Cracow
    Posts
    34
    Thanks
    2
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default QTreeView and expanding items just added

    Hi,

    I'm facing similar case as in http://www.qtcentre.org/threads/2601...View-expanding

    The problem is that I restore model items and while I'm doing that I want to also apply expanding info to nodes. Unfortunately it looks like QTreeView hasn't "updated" it's rendering for items, therefore my calls to "tree->expand(item->index())" don't work.

    What I'm doing is adding items, then adding childs to items and then applying expand() to certain top level items. It's all done in the same method, so I guess this is the issue here.

    I think I can extend QTreeView to implement support for my custom items that have "expanded" flag and render it accordingly. I just don't know how to make it the simplest way. How would that be?

    Regards,
    Pawel

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTreeView and expanding items just added

    Please provide a minimal compilable example reproducing the problem.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 1
    Last Post: 5th March 2012, 19:26
  2. QListWidget - signal when items are added/removed
    By Andrej08 in forum Qt Programming
    Replies: 1
    Last Post: 19th January 2011, 02:13
  3. Restore QTreeView expanding
    By zack in forum Qt Programming
    Replies: 1
    Last Post: 25th November 2009, 17:54
  4. Associate userData to items added to a QListWidget.
    By schall_l in forum Qt Programming
    Replies: 3
    Last Post: 4th August 2009, 12:24
  5. Replies: 1
    Last Post: 28th February 2007, 08:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.