Qt World Summit: Submit your Presentation

How to control size of widgets of QSplitter container?

  • Hello

    I need a QSplitter with fixed-seze right side and expanding left side. tried with change horizontal stretch of right widgets to 0 and left widgets to 1 but not works and also inner layout of right widgets are impaired.

  • What I found out worked as an approach, is to only put QWidgets or other containers in the different pannels of your splitter. These you can give a horizontal stretch. Then, put the contents of the panels as children of these container widgets, and apply a layout as normal to anchor the contents to the container.

  • Thanks.
    It works well. I expected a solution based on QSplitter itself, feeling it should be related to splitter itself. not children :-/

Log in to reply