Size Policy with TabWidget.

  • Hello,

    I have a QDockWidget with a QWidget inside, with a QCustomPlot inside (QDockWidget->QWidget->QCustomPlot) and I can resize (stretch) it without a problem. All with "Preferred/Preferred" size policy.

    I also have a QDockWidget->QWidget->QTabWidget->QWidget->QCustomPlot but even though I can resize the dock, the tab and the rest doesn't change size. I tried with all of them in "Preferred/Preferred" and "Expanding/Expanding" size policies but still get the same result.

    Is it possible to resize when you have a tab? Any solution?

    I am new to Qt so have been using Qt Designer.


  • What you expect is default behaviour provided you properly set the layouts on all bold QWdigets.


  • Got it working. I right clicked on the "QDockWidget" and "QTabWidget" then added a vertical Layout. This added the layout property to the two QWidgets you mentioned.

    I will find out more information on layouts.

    Thank a lot!

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.