Results 1 to 7 of 7

Thread: Letting the Layout fill the whole area of the parent

  1. #1
    Join Date
    Dec 2008
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Letting the Layout fill the whole area of the parent

    Hi,
    I am new to Qt and I am using the Qt Creator.
    I was wonderin how I can set a layout into a Frame/Widget (e.g. Tab Widget) which automatically expands to the widgets size?
    Like the Top Level Layouts do.

    When I place a Layout on a Frame/Widget the layout always has a fixed size and if I resize the Widget/Frame the layout does not resize equally. It stays static.

    Isnt there a way to tell the Layout that it should always take the same size as the parent Frame/Widget has?

    Basically just want the layouts to behave like the top level layouts behave when they are on the mainwindow.
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Letting the Layout fill the whole area of the parent

    Click on the background of the tab and choose a layout for example from the toolbar or context menu.
    J-P Nurmi

  3. #3
    Join Date
    Dec 2008
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Letting the Layout fill the whole area of the parent

    Once I clicked on the background (and thus selected the tab widget) the layouts on the tool bar are disabled. And from the the context menu (which for me is the rightclick menu) doesnt provide any layouts.
    And clicking on the Menu where all the widgets/layouts, etc are available doesnt do anything. I have to drag the layout into the tab widget. But once dragged in it has a fixed size. I can resize it, but it will stay fix independed from the size of the tab window.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Letting the Layout fill the whole area of the parent

    Can you attach the .ui file?
    J-P Nurmi

  5. #5
    Join Date
    Dec 2008
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Letting the Layout fill the whole area of the parent

    Here is the .ui File
    Attached Files Attached Files

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Letting the Layout fill the whole area of the parent

    Here it is with a layout installed like I described above:
    Attached Files Attached Files
    J-P Nurmi

  7. #7
    Join Date
    Dec 2008
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Thumbs up Re: Letting the Layout fill the whole area of the parent

    Thx mate.
    AlthoughI couldnt understand why it worked with you and not with me, I do know now.

    My Problem was that I tried to put a layout on the tab before it had any widgets in it. But it only works once there is one widget in it. Then the layouts on the toolbar are enabled.

    Thank you for helping (especially that fast).
    Last edited by draGy; 18th December 2008 at 21:24.

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.