Results 1 to 3 of 3

Thread: QListView: how to adding column text?

  1. #1
    Join Date
    Dec 2008
    Posts
    68

    Default QListView: how to adding column text?

    In Q3ListView, setColumnText() is used to set the name of each column. But this is removed in QListView. Is there a way to set up it?

    Also, is there a way to set the height of text bar for each column in Q3ListView? All the letters "g" and "q" are but at bottom. how about in QListView?

    thank you,

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,677
    Thanks
    13
    Thanked 1,596 Times in 1,524 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QListView: how to adding column text?

    As the QListView docs say:
    This view does not display horizontal or vertical headers; to display a list of items with a horizontal header, use QTreeView instead.
    The default column and row heading would typically be provided by the underlying model in Qt4/Qt5 and displayed in the default QHeaderView. You can replace the default QHeaderView or the data underlying it if you wish.

    If you use the QTreeWidget subclass then the internal model's headers are accessed with QTreeWidget::setHeaderLabel().

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QListView: how to adding column text?

    As ChrisW67 said use a QTreeWidget or QTreeView.
    It is the equivalent of Qt3's QListView.

    Qt4 and Qt5's QListView is more like Qt3's QListBox

    Cheers,
    _

Similar Threads

  1. How to get count of items in QListView column?
    By qt-closer in forum Qt Programming
    Replies: 3
    Last Post: 25th October 2010, 15:40
  2. Map QSqlTableModel Column 2 To QListView
    By donmorr in forum Qt Programming
    Replies: 2
    Last Post: 1st September 2010, 13:50
  3. Can a QListView support multi-column?
    By wesley in forum Qt Programming
    Replies: 3
    Last Post: 7th March 2008, 09:00
  4. Editable QListView Column ??
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 3rd May 2006, 19:55
  5. QListView and column moving
    By gadnio in forum Qt Programming
    Replies: 10
    Last Post: 5th January 2006, 18:13

Tags for this Thread

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.