Results 1 to 17 of 17

Thread: Center a widget in a cell on a QTableWidget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2008
    Posts
    25
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Center a widget in a cell on a QTableWidget

    Quote Originally Posted by drescherjm View Post
    Thanks. The last example worked for me however the checkbox appears slightly off center in the cell. Any ideas what causes that?

    This is in Qt 4.3 on windows XP.
    Hi,

    I'm just guessing here, but maybe you could try layout->setSpacing( 0 ) and check if this changes anything

  2. #2
    Join Date
    Apr 2008
    Location
    Pittsburgh,PA,USA
    Posts
    48
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Center a widget in a cell on a QTableWidget

    Thanks, I will try that.

    My first guess for the reason was that there was some space auto allocated for the label that can appear next to the checkbox.

    If you have not guessed I am a former MFC programmer...
    John

Similar Threads

  1. repaint a cell or row in QTableWidget
    By alphaqt in forum Newbie
    Replies: 6
    Last Post: 26th June 2012, 11:21
  2. Pin/Unpin Dock Widget
    By charlesD in forum Newbie
    Replies: 1
    Last Post: 21st June 2006, 06:57
  3. Replies: 4
    Last Post: 24th March 2006, 22:50
  4. QTableWidget
    By campana in forum Qt Programming
    Replies: 7
    Last Post: 24th February 2006, 08:45
  5. [Qt 4.1.0] Split a widget on demand
    By Townk in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 14:16

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.