3

I am working on a QGIS plugin. The plugin has a panel with two QListWidget and buttons, labels, etc. I would like to expand horizontally and vertically the lists if panel resized. I set the hsizetype and vsizetype to Expanding for both lists. Unfortunately lists are not expanding vertically after a given size. What should I change in the Qt ui file to expand lists?

You can find my ui file here: https://github.com/zsiki/thematics/blob/master/thematics_dockwidget_base.ui

enter image description here

Additional information

Following Kadir's answer I had to change verstretch to 1 for the main widget (QDockWidget) to get the desired behavior of my panel.

4

Change verstretch value from 0 to 1 for two QListWidgets.

<widget class="QListWidget" name="list_projects">
  <property name="sizePolicy">
    <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
      <horstretch>0</horstretch>
      <verstretch>1</verstretch>  <!-- change to 1-->
    </sizepolicy>
  </property>
</widget>
2
  • Thanks, if I set verstretch to 1 on both lists the expansion is not balanced, first list is expanded more. I would like balanced expansion. List are expanded horizontally without horstretch set to 1.
    – Zoltan
    Feb 21 '20 at 17:49
  • I add comment to my question, thanks.
    – Zoltan
    Feb 21 '20 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.