Results 1 to 4 of 4

Thread: How to put a vertical header of a QTableWidget on the right side of the table?

  1. #1
    Join Date
    Nov 2007
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to put a vertical header of a QTableWidget on the right side of the table?

    Hello,

    I'm trying to create a table with a vertical table header on the right side of the table.
    Is this possible?

    Thanks in advance,

    Lunochod

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

    Default Re: How to put a vertical header of a QTableWidget on the right side of the table?

    Yes, it should be possible. You'd need to subclass the table, use QWidget::setContentsMargins to make a margin on the right of the widget instead of the left one and reimplement resizeEvent to adjust the geometry of the header.

  3. #3
    Join Date
    Feb 2010
    Location
    Hyderabad, India
    Posts
    15
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to put a vertical header of a QTableWidget on the right side of the table?

    Do we need to do that now Or do we have any property to move the vertical header to the right with the more latest versions of Qt ?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to put a vertical header of a QTableWidget on the right side of the table?

    The vertical header is always on the left unless you set your widget to a right-to-left layout (but this will reverse all the contents as well, column 0 will be most-right, etc.). If you wish to override this behaviour, you're on your own.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QTableWidget NW corner header item?
    By McKee in forum Qt Programming
    Replies: 9
    Last Post: 31st May 2012, 00:44
  2. Showing Icon in vertical header of a table
    By vishal.chauhan in forum Qt Programming
    Replies: 7
    Last Post: 15th January 2007, 11:44

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.