Results 1 to 2 of 2

Thread: QTableWidget custom header labels

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    132
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTableWidget custom header labels

    I am trying to put labels instead of default labels, but this does not work for me, still seeing the numbers instead.

    Qt Code:
    1. QStringList headerLabels;
    2. headerLabels << "Title" << "Genre" << "Artist" << "Rating";
    3. this->setHorizontalHeaderLabels(headerLabels);
    4. this->resizeColumnsToContents();
    5. this->setColumnCount(4);
    To copy to clipboard, switch view to plain text mode 


    example from:
    http://doc.qt.nokia.com/latest/itemv...rdelegate.html
    Last edited by wysota; 1st June 2011 at 09:20. Reason: missing [code] tags

Similar Threads

  1. Setting two horizontal header labels for QTablewidget
    By arunvv in forum Qt Programming
    Replies: 2
    Last Post: 20th August 2009, 17:58
  2. combo box in Header of QTableWidget
    By sar_van81 in forum Qt Programming
    Replies: 1
    Last Post: 6th February 2008, 16:58
  3. QSlider with a custom set of labels for the tick marks?
    By whitefurrows in forum Qt Programming
    Replies: 3
    Last Post: 5th August 2007, 16:05
  4. QTableWidget, header behavior
    By hyling in forum Qt Programming
    Replies: 1
    Last Post: 14th October 2006, 08:03
  5. Replies: 1
    Last Post: 23rd August 2006, 18:02

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
  •  
Qt is a trademark of The Qt Company.