Results 1 to 5 of 5

Thread: QTableWidget resizing when is part of QSplitter

  1. #1
    Join Date
    Jun 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Question QTableWidget resizing when is part of QSplitter

    Hello,

    I have a QTableWidget inside a QSplitter and I need the table sections to equally resize when the handle of the QSplitter is moved. This behavior can be achieved by setting a QLinearLayout to the splitter area where the table is and setting the resize mode QHeaderView::Stretch to the table header.

    However, in this configuration the user cannot resize manually the width of the columns that is the other need I have.

    Is there any way the user can resize manually the width of the columns while these columns are automatically resized when the handle of the splitter is moved?

    Thanks is advance.

  2. #2
    Join Date
    Jun 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QTableWidget resizing when is part of QSplitter

    Nobody can help me? I haven't found any solution to this yet.

    Thanks in advance.

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

    Default Re: QTableWidget resizing when is part of QSplitter

    If you have a concept of dealing with a situation that the user resizes some of the columns and then moves the splitter then you can implement your solution by overriding resizeEvent() for the table widget and writing code for adjusting column sizes.
    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.


  4. #4
    Join Date
    Jun 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QTableWidget resizing when is part of QSplitter

    Hello wysota,

    I have been outside for several days and I had not read this.

    I have implemented the solution you suggested me and it works fine when the splitter is moved because I can control how the new available space is shared among the columns.

    However, there is no resize event when a column is resized, then it is not possible to resize the rest of the columns when one of them expands or shrinks.

    Is there any solution to know when a column has been resized?

    Thanks in advance.

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

    Default Re: QTableWidget resizing when is part of QSplitter

    QHeaderView emits a signal.
    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. Resizing headers view in the QTableWidget
    By jano_alex_es in forum Qt Programming
    Replies: 1
    Last Post: 27th January 2010, 10:55
  2. QSplitter and QTableWidget
    By vanwil in forum Qt Programming
    Replies: 4
    Last Post: 19th January 2010, 09:40
  3. Resizing QTableWidget Columns
    By mbrusati in forum Qt Programming
    Replies: 4
    Last Post: 29th September 2008, 22:26
  4. QTableWidget column width and resizing
    By shooogun in forum Qt Programming
    Replies: 2
    Last Post: 16th March 2008, 22:31
  5. Show/hide part of dialog with resizing.
    By Spockmeat in forum Qt Tools
    Replies: 6
    Last Post: 7th June 2006, 08:22

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.