Results 1 to 1 of 1

Thread: Shape Changing window? (how to resize the layout/widget/mainwindow?) (thumbnail)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2010
    Posts
    24
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Shape Changing window? (how to resize the layout/widget/mainwindow?) (thumbnail)

    How can i fixate the size and position of a widget in a layout, and the size of the layout(parent-widget) ?

    I try to mimic a shape changing dialog window (with a More>> -type button).

    I have a hidden groupBox placed at the bottom of the layout(dialog) and when i hide() it, the widgets "on top" of it, slide down occupying all the Dialog.

    I have created two sublayouts(one containing the top widgets) and one containing the bottom groupBox. They are both included with a .addLayout(lay_top) .addLayout(lay_bottom) into a main VBoxLayout (setLayout in the myDialog constructor). The top-layout contains a label + a button + a textedit. When i click the button, a slot toggles hide()/show() on the groupBox.

    What I want is :

    Step 1. "Fix" the position (and size) of top layout.
    Step 2. hide() bottom groupBox widget (which is in the bottom layout)
    Step 3. Shrink-resize the size of the dialog (preferably to whatever I want but still displays top-layout)
    Step 4. Now let the widgets in top-layout hog all the space they want (in case the user resizez the dialog window using the mouse)


    PS: i have tried this using a widget directly set as central in MainWindow but it behaves differently than a Dialog Window.

    Attached Dialog shown here "sliding/spilling" down:
    Attachment 5777ScreenShot002.pngScreenShot003.png
    Last edited by BillGates; 18th January 2011 at 17:13.

Similar Threads

  1. mainwindow layout vs widget layout
    By fatecasino in forum Newbie
    Replies: 2
    Last Post: 14th December 2010, 14:45
  2. Replies: 2
    Last Post: 29th June 2010, 00:40
  3. changing layout of a widget
    By mikro in forum Qt Programming
    Replies: 10
    Last Post: 4th August 2009, 20:21
  4. Shape changing under other tab using slider/spinbox
    By kramed in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2007, 19:59
  5. Shape-changing dialog with qt4.1
    By moe in forum Qt Tools
    Replies: 3
    Last Post: 2nd February 2006, 10:12

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.