Results 1 to 3 of 3

Thread: QTreeViews should not expand!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTreeViews should not expand!

    Hi!

    I have written my own model based on a QAbstractTableModel
    I first tried to use QTableView as View, but it doesn't meet my requirements, I do not want to have header for rows. So I decided to use QTreeView, which is nearly perfect. The only problem I am faced to is that I have an expand button in front of every row, if I click it the row expands and its contents become the same as the first level's.
    I can disable this expanding by setItemExpandable(false), but I still have the expand button. How can I make this button disappear?

    Thank you very much for your help!

    zwwe

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTreeViews should not expand!

    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTreeViews should not expand!

    It seems that your model's implementation is wrong. How did you implement hasChildren()?

    Can't you use QTableView and just hide the vertical header?

Similar Threads

  1. Simple way to expand all nodes on a QTreeView?
    By cboles in forum Qt Programming
    Replies: 10
    Last Post: 12th April 2014, 16:54
  2. QTableWidget columns to expand to window size
    By bruccutler in forum Newbie
    Replies: 1
    Last Post: 13th April 2007, 16:02
  3. How to set visible the QTreeWidgetItem expand '+' mark
    By mcostalba in forum Qt Programming
    Replies: 3
    Last Post: 14th January 2007, 03:21
  4. howto expand frame to maximum size
    By masoroso in forum Newbie
    Replies: 4
    Last Post: 21st April 2006, 09:40

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.