Results 1 to 3 of 3

Thread: Problem with layout -- need to prevent stretching of grid(s) separated by splitter

  1. #1
    Join Date
    Feb 2015
    Posts
    7
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Problem with layout -- need to prevent stretching of grid(s) separated by splitter

    The problem is as follows -- I have one QCustomPlot from the left side and GridLayout from the right, they are separated by splitter. Undesired effect is that grid layout is getting stretched to the maximum. I would like to prevent that. Need to have QCustomPlot stretched instead. I think I have tried everything (e.g. horizontal size policy Minimum for the grid, Maximum for the plot), also been reading similar posts here, but no solution. Would be grateful if someone can help or give an advice.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,734
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem with layout -- need to prevent stretching of grid(s) separated by splitte

    Qt Code:
    1. Splitter->setStretchFactor(0, 1);
    2. Splitter->setStretchFactor(1, 0);
    To copy to clipboard, switch view to plain text mode 
    Should make the left column gain all new space that becomes available.

  3. #3
    Join Date
    Feb 2015
    Posts
    7
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Problem with layout -- need to prevent stretching of grid(s) separated by splitte

    You saved my day. Thank you a lot!

Similar Threads

  1. Replies: 2
    Last Post: 6th September 2013, 05:13
  2. [QSplitter] How to prevent splitter snapping?
    By faizol in forum Qt Programming
    Replies: 5
    Last Post: 22nd October 2012, 16:10
  3. Problem in layout widgets in a grid
    By franco.amato in forum Newbie
    Replies: 31
    Last Post: 24th November 2010, 22:22
  4. Grid Layout problem
    By succorguy in forum Qt Programming
    Replies: 1
    Last Post: 26th April 2009, 23:01
  5. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45

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.