Results 1 to 2 of 2

Thread: How to remove the dot line in QTreeWidget?

  1. #1
    Join Date
    Mar 2009
    Location
    Nanjing,China
    Posts
    40
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default How to remove the dot line in QTreeWidget?

    I use the QTreeWidgt like this:
    Qt Code:
    1. QTreeWidget* pShowListView = new QTreeWidget;
    2. QTreeWidgetItem* item = NULL;
    3. QTreeWidgetItem* preItem = NULL;
    4. for( ...; ...; ....)
    5. {
    6. item = new QTreeWidgetItem(pShowListView,preItem);
    7. //init the item value
    8.  
    9. preItem = item;
    10. }
    To copy to clipboard, switch view to plain text mode 

    then how can I remove the line in my Treewidget?
    the line like this:

    |__My Record A
    |__My Record B
    |__My Record C
    |__My Record D

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to remove the dot line in QTreeWidget?

    If you only have top level items in the tree, using QTreeView::setRootIsDecorated(false) will do the trick.

    If you have many levels, then you might need delegates or styleSheets...
    Last edited by wysota; 14th May 2009 at 09:59. Reason: reformatted to look better

Similar Threads

  1. QTextStream : Remove a Line?
    By kaydknight in forum Qt Programming
    Replies: 7
    Last Post: 31st January 2011, 18:15
  2. QTcpSocket exception.
    By Fastman in forum Qt Programming
    Replies: 9
    Last Post: 29th January 2008, 13:51
  3. Qwizard crashed when created in a slot
    By joshlareau in forum Qt Programming
    Replies: 9
    Last Post: 15th January 2008, 09:16
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42

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.