Results 1 to 3 of 3

Thread: QtableWidget: How to set two HorizontalHeaderLabels?

  1. #1
    Join Date
    Mar 2015
    Posts
    105
    Thanks
    50

    Default QtableWidget: How to set two HorizontalHeaderLabels?

    Good evening!

    How can i set two HorizontalHeaderLabels in a qtablewidget?

    Thanks!

  2. #2
    Join Date
    Feb 2012
    Location
    Warsaw, Poland
    Posts
    37
    Thanks
    3
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: QtableWidget: How to set two HorizontalHeaderLabels?

    What would you like to achieve?

  3. #3
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: QtableWidget: How to set two HorizontalHeaderLabels?

    If you are looking for multi-line label, then just use '\n'
    Qt Code:
    1. tableWidget.setHorizontalHeaderLabels(QStringList() << QString("Hello\nWorld"));
    To copy to clipboard, switch view to plain text mode 
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. Replies: 1
    Last Post: 6th January 2011, 04:19
  2. QTableWidget
    By pippo42 in forum Qt Programming
    Replies: 1
    Last Post: 12th November 2009, 13:42
  3. QTableWidget
    By kishore7771 in forum Newbie
    Replies: 3
    Last Post: 6th October 2009, 06:46
  4. QTableWidget
    By cmaxb in forum Qt Programming
    Replies: 1
    Last Post: 11th November 2006, 08:49
  5. QTableWidget
    By chak_med in forum Qt Programming
    Replies: 1
    Last Post: 17th May 2006, 15:53

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.