Results 1 to 2 of 2

Thread: resize tableview when resizing mainwindow

  1. #1
    Join Date
    Sep 2013
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default resize tableview when resizing mainwindow

    I am new to gui development (long time embedded programmer) and am not experienced in the correct way to create a window. I have a summary window that has a central widget that contains a table view.
    The columns of the QTableView resize to their contents and I have the size of the tableview such that it sizes to the initial width of the columns. If I update a row that makes the columns wider, the tableview expands to fit the columns but I get a scroll bar at the bottom. If I drag the corner of the main window I expected the tableview to expand thus eliminating the scroll bar but this does not happen. Is there an attribute or association I'm missing that prevents this kind of behavior? .
    An alternative (and one which would be ideal) would be to automatically resize the entire main window and tableview to match whatever width the columns attain.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: resize tableview when resizing mainwindow

    Sounds like your central widget is missing a layout.

    Check that you have a layout on your central widget, that all children have been added to that layout, and if you have any container widgets with grand children, then check that they have layouts as well.

    Cheers,
    _

Similar Threads

  1. Resize TableView to that of parent
    By Qt::maniac in forum Newbie
    Replies: 2
    Last Post: 20th August 2013, 16:31
  2. Resizing of Mainwindow
    By vidya.p in forum Newbie
    Replies: 1
    Last Post: 22nd November 2011, 07:38
  3. resizing widgets when user resizes mainwindow
    By Mystical Groovy in forum Qt Programming
    Replies: 13
    Last Post: 21st December 2009, 00:03
  4. resizing graphicsView when user resizes mainwindow
    By mirelon in forum Qt Programming
    Replies: 0
    Last Post: 20th December 2009, 22:43
  5. problem while resizing mainwindow.
    By phillip_Qt in forum Qt Programming
    Replies: 7
    Last Post: 10th November 2009, 08: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.