+ Reply to Thread
Results 1 to 2 of 2

Thread: qt4+xp: QTreeView w/o header ?

  1. #1
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default qt4+xp: QTreeView w/o header ?

    Is it possible to create a QTreeView without header :
    Qt Code:
    1. model = new QStandardItemModel(0, 2, this);
    2. model->setHeaderData(0, Qt::Horizontal, "Mois");
    3. model->setHeaderData(1, Qt::Horizontal, "Facture");
    To copy to clipboard, switch view to plain text mode 


    I used this code for the model, but if I remove setHeaderData it add new labels anyway that are the column numbers ?

    How can have only the data rows and no header ?

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

    Default Re: qt4+xp: QTreeView w/o header ?

    Qt Code:
    1. QTreeView *tv = new QTreeView(...);
    2. //...
    3. tv->header()->hide();
    To copy to clipboard, switch view to plain text mode 

  3. The following 2 users say thank you to wysota for this useful post:

    ericwny (18th September 2008), incapacitant (5th March 2006)

+ Reply to Thread

Similar Threads

  1. How to edit Horizontal Header Item in QTableWidget
    By ioannis in forum Qt Programming
    Replies: 6
    Last Post: 5th March 2013, 18:50
  2. Howto : Header and Footers
    By pshah.mumbai in forum Qt Programming
    Replies: 0
    Last Post: 29th October 2008, 15:32
  3. How to determine the header row height in QTreeView
    By ghorwin in forum Qt Programming
    Replies: 3
    Last Post: 20th September 2007, 19:39
  4. QTreeView and QDirModel Header Sort Question
    By jimroos in forum Qt Programming
    Replies: 1
    Last Post: 20th March 2007, 08:04
  5. Replies: 0
    Last Post: 10th November 2006, 13:46

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