Results 1 to 10 of 10

Thread: Resize widget towards Right

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2013
    Posts
    41
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Resize widget towards Right

    Hello,

    Please have a look at the attachment (shot.jpg). I have two widgets. Widget1 is placed first and its size is fixed (as desired).
    The Widget2 is places next to it using the addStrech() method.

    Following are the lines relevant to placement of Widget2:

    Qt Code:
    1. QHBoxLayout *mLayout = new QHBoxLayout(this);
    2. mWidget2 = new Widget2(this); //assigning pointer to Widget2
    3.  
    4. mLayout->addStretch(0);
    5. mLayout ->addWidget(mWidget2);
    To copy to clipboard, switch view to plain text mode 

    When I resize the window, I would want to resize Widget2 towards right while keeping it fixed at the left (also shown in attachement).

    How can I achieve this?
    Attached Images Attached Images

Similar Threads

  1. Replies: 5
    Last Post: 20th June 2012, 19:02
  2. How to resize parent widget when child widget is resized
    By ainne810329 in forum Qt Programming
    Replies: 4
    Last Post: 29th November 2011, 07:47
  3. child widget resize to parent widget
    By bobFromAccounting in forum Newbie
    Replies: 10
    Last Post: 11th February 2011, 02:53
  4. Widget Resize
    By manojmka in forum Qt Programming
    Replies: 9
    Last Post: 21st May 2010, 12:32
  5. Replies: 1
    Last Post: 1st May 2010, 23:03

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.