Results 1 to 2 of 2

Thread: QTreeView. Qt.4.4.1

  1. #1
    Join Date
    Nov 2008
    Qt products

    Default QTreeView. Qt.4.4.1

    I have a problem with QTreeView...which I dont know is a feature or a bug.

    I have a Treeview (same for treeviewWidget) with a header and 4 columns.

    I add rows like:
    equipment 1
    equipment 2

    where row1, "concentrator" is in column 1
    and row2, row3 "equipment" is in column 2 and defined with addChild to row1,

    I want to make a tree very similar to file explorer...and use the sort possibility in treeview..

    I have disabled wordwrap.

    Now when I move column 2 towards colum1 (make column1) shorter, the text "concentrator" is cut....

    How can I make the text of column1 to "spill" into column 2 so that the text is not cut..
    This is a normal behaivour in spreadsheets (when wordwrap is off) but it seems impossible with treeview..

    I know the alternative is to write all data in column 1, and have a second treeviewwidget with the headers...and then do all the programmning myself.

    have a nice day, and thanks in advance for the replies.

  2. #2
    Join Date
    Jan 2006
    Warsaw, Poland
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits

    Default Re: QTreeView. Qt.4.4.1

    I think you should put the children of the top item into column one and not column two. As they are children, they will be displayed indented relative to their parent. Then your problem will go away itself.

Similar Threads

  1. QDirModel and QTreeView cut and paste
    By Micawber in forum Qt Programming
    Replies: 4
    Last Post: 28th May 2008, 21:16
  2. QTreeView help
    By bepaald in forum Qt Programming
    Replies: 1
    Last Post: 15th August 2007, 22:22
  3. QTreeView: Holding a line on screen
    By gri in forum Qt Programming
    Replies: 1
    Last Post: 7th August 2007, 12:42
  4. background image in QTreeView
    By momesana in forum Qt Programming
    Replies: 2
    Last Post: 11th January 2007, 07:25
  5. paint QTreeView item !!
    By mcenatie in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2006, 15:24

Tags for this Thread


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.