Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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.

    image_2021-10-05_170957.png

    The initial window when using ctrl-R.

    image_2021-10-05_171037.png

    After expanding the window using mouse.

    image_2021-10-05_171055.png

    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.
    SherrilB


Log in to reply