Important: Please read the Qt Code of Conduct -

Qt Designer: make widgets inside QToolBox pages expand

  • I have an issue using Qt Designer. I am unable to make widgets belonging to QToolBox pages expand with QToolBox. (also with QTabWidget.)

    Here is the object inspector.


    The initial window when using ctrl-R.


    After expanding the window using mouse.


    The toolbox expands but not its contents.

    As you can see I have a lot of (probably) extraneous widgets in attempting to work through this. I (think) I understand that for a widget to expand it has to be associated with a QLayout.

    But, so far, no joy.

    Any help will be appreciated.

  • In your Designer object inspector, each of the layout icons with a "stop" symbol superimposed (e.g. ignore_dirs_toolbox_page) is a widget without a layout applied to it. Layout-free widgets will not resize their content. Note, this is different to nesting a layout inside another which, for example, is what ignore_dirs_layout is.

    • Select ignore_dirs_toolbox_page
    • Apply a horizontal layout (from the designer toolbar or context menu IIRC)
    • You then do not need ignore_dirs_layout
    • Repeat applying layout to "frame", "ignote_dir_frame" ...

  • @ChrisW67 Thank you for your excellent reply.

    I'm learning a little bit each day. Two things I learned from your reply were:

    1. the stop sign indicates a widget not associated with a layout.
    2. that an widget in the Object Inspector can be right clicked to associate the object with a layout.

    I really appreciate the help.

Log in to reply