Results 1 to 2 of 2

Thread: How to stretch widgets to fill the layout size

  1. #1
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default How to stretch widgets to fill the layout size

    I have a QHBoxLayout in which there are two elements. First element is QTableWidget and second is QVBoxLayout. I didn't set any spaces to the layouts or the widgets inside the layouts.
    I want the QTableWidget and QVBox layout to share the spaces automatically without giving size constraints to it. Can it be done ?

  2. #2
    Join Date
    Apr 2011
    Location
    Russia
    Posts
    85
    Thanks
    2
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to stretch widgets to fill the layout size

    QHBoxLayout::addWidget( QTableWidget, 1 );
    QHBoxLayout::addLayout( QVBoxLayout, 1 );

  3. The following user says thank you to Jonny174 for this useful post:

    rawfool (20th April 2012)

Similar Threads

  1. Replies: 6
    Last Post: 14th March 2018, 20:25
  2. Replies: 1
    Last Post: 14th February 2012, 14:13
  3. [QGraphicsView] Size stretch
    By bspitz in forum Qt Programming
    Replies: 4
    Last Post: 10th May 2011, 09:23
  4. problems with layout - (stretch)
    By pakine in forum Qt Programming
    Replies: 3
    Last Post: 25th August 2010, 13:42
  5. Qt layout space + stretch
    By bunjee in forum Qt Programming
    Replies: 3
    Last Post: 20th December 2007, 15:53

Tags for this Thread

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.