Results 1 to 2 of 2

Thread: Centering a table in QTableWidget

  1. #1
    Join Date
    Mar 2019
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Question Centering a table in QTableWidget

    Hi. After looking through the documentation, I don't think there is a built-in way to do this so I want to ask what approach people here thought was best.

    I have a qTableWidget and I want to have the table centered.
    Untitled.png

    I want to have this table centered. How can I do this? I'm very lost. Thanks. Let me know if you need any more information.
    Last edited by Malorn44; 3rd April 2019 at 19:18. Reason: mistake in image upload

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    503
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Centering a table in QTableWidget

    Hi, I'm not sure if you can center the table inside the QTableWidget, but you could try to make the QTableWidget just as large as required for the contents, and then center the complete QTableWidget inside its parent widget, e.g. with a QGridLayout and some spacers.

    Ginsengelf

Similar Threads

  1. Replies: 2
    Last Post: 8th February 2017, 06:51
  2. Unable to see the table created by QTableWidget
    By swathisri in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2013, 14:15
  3. Centering QPushButton within a QTableWidget
    By bob2oneil in forum Qt Programming
    Replies: 7
    Last Post: 11th November 2011, 11:26
  4. QTableWidget resizeColumnsToContents for whole table?
    By lalesculiviu in forum Qt Programming
    Replies: 1
    Last Post: 2nd March 2010, 01:08
  5. QTableWidget - scrolling to bottom of the table
    By mkhoang in forum Qt Programming
    Replies: 4
    Last Post: 12th November 2008, 18:21

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.