Results 1 to 6 of 6

Thread: layout

  1. #1
    Join Date
    Sep 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default layout

    What's the difference beetween selecting a layout in QtCreator from the toolbox or from the toolbar?
    When I select it from toolbox I can see it in pink in the designer. When I apply it from the toolbar I see the result but there are no pink borders.
    But I would like to know what is the difference bettween this two ways of using a layout. Thanks


    edit: maybe selecting it from toolbox it's posible to apply more than one layout to one widget. But is there some other difference?
    Last edited by pedro74; 29th September 2016 at 18:21.

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

    Default Re: layout

    The toolbar icon will create a layout of the selected type, intelligently put all the existing contained widgets and layouts into the new layout, and arrange for it to be attached to the content area of the widget being designed. There would be few instances where you did not use one of the layout tools.

    The tool box layout buttons create layouts that are not directly attached to the widget being designed. You can place other widgets and layouts inside. These layouts are intended to become sub-elements of the main layout of the widget being designed (or sub layouts of another sub layouts), i.e. The sub-layout fills/organises a parent layout cell like a widget would. For simple designs you may not need to use these toolbox options, but any complex UI is likely to need them.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: layout

    Nested layout can also be achieve with the toolbar buttons, if you select multiple individual widgets inside the same parent.

    Cheers,
    _

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

    Default Re: layout

    If there are no widgets selected then the layout tool button will act on the topmost widget under design. If you select multiple widget with different parents (already in different layouts) then you cannot put these in the same layout and the tool buttons are likely disabled: a very quick experiment would confirm this.

  5. #5
    Join Date
    Sep 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: layout

    Thank you very much for the answares.
    I only wanted to say one more thing.
    As I undesrstand, with toolbox layout you can also manage the layout programmatically, using it as an ui element.
    It cannot be done with toolbar layout.
    Is it correct?
    Thanks

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: layout

    Both result in the same generated code.

    Cheers,
    _

Similar Threads

  1. Replies: 1
    Last Post: 18th March 2016, 15:08
  2. Replies: 6
    Last Post: 13th February 2011, 23:06
  3. Hiding Layout item - Layout does not use available space
    By Asperamanca in forum Qt Programming
    Replies: 0
    Last Post: 27th January 2011, 09:51
  4. Replies: 0
    Last Post: 12th December 2010, 05:09
  5. Replies: 0
    Last Post: 25th May 2009, 10:00

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.