Results 1 to 3 of 3

Thread: horizontal header over two rows in tablewidget

  1. #1
    Join Date
    Apr 2008
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default horizontal header over two rows in tablewidget

    I like to have a horizontal header in a qTableWidget that looks like the following example (header over two rows):

    -------------------------------------------------------
    Amount
    -------------------------------------------------------
    1.00 | 2.25 | 4.00 | 5.25 | 8.00 | 13.00 | 15.00
    -------------------------------------------------------

    How can I do that?

    I am working with QT4.3.0!

    Thanks for any help.

    Nippler

  2. #2
    Join Date
    Jan 2006
    Posts
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: horizontal header over two rows in tablewidget

    If it's the last header column, you should be able to use the header's stretchLastSection option. Something like:

    Qt Code:
    1. tableWidget->horizontalHeader()->setStretchLastSection(true);
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Apr 2008
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: horizontal header over two rows in tablewidget

    Thanks for the answer but that isn't what I want. This stretches only the last section horizontally. What I want is a describing header over the real header per column like the example in my 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, 19:50
  2. Replies: 1
    Last Post: 23rd August 2006, 19: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.