Results 1 to 3 of 3

Thread: QTableWidget -- how to handle column resizing? (QHeaderView)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QTableWidget -- how to handle column resizing? (QHeaderView)

    You can install an event filter on the header view and mark the event as handled (by returning true from the eventFilter() method) so that the table widget doesn't receive them.

    I suspect it'd be easier to subclass the table widget and reimplement its resizeEvent and update the columns there after the header gets adjusted by the original resizeEvent (you have to call the base class implementation yourself of course).

    BTW. Have you tried to simply set the resizeMode of the second column in the header to Stretch?
    Last edited by wysota; 14th August 2007 at 13: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
  •  
Qt is a trademark of The Qt Company.