View Full Version : QTabWidget - problem with resizing

12th September 2006, 17:41

I have a problem with resizing QTabWidget. I want that my tabs (2) resize accordingly to the window (window of some kind) that they are appended to.
i have a dialog, which i can resize and tabs lying south from it. I don't know how to resize the tabs accordingly to the dialogs size. any help??

12th September 2006, 19:22
Perhaps you just need to set those tabs inside a layout? If you're using designer, can just right-click->Lay out in a grid?

13th September 2006, 10:18
Ok. I'll try that. I have another problem with resizing and it's with dockwidget. I want it to have the smallest size by default (i already set setMinimumSize()) when it's in vertical position, but i still want to have the luxury to extend it, while when it's in horizontal position I want it to expand as much as possible.
I use:
setSizePolicy(QSizePolicy::MinimumExpanding,QSizeP olicy::MinimumExpanding);

but this doesn't do the trick -> it works only for when it's in horizontal mode, in vertical it extend beyound the smallest size.

14th September 2006, 12:19
Does anyone have any clue how to solve this?

14th September 2006, 14:23
if you want small size then use setMaximumWidth() or setMaximumSize().

here I am pasting my application code:

m_pWorkspaceDockWidget = new QDockWidget( "Workspace Explorer", this );

m_pWorkspaceDockWidget->setFeatures( QDockWidget::AllDockWidgetFeatures );

addDockWidget( Qt::LeftDockWidgetArea, m_pWorkspaceDockWidget );
m_pWorkspaceDockWidget->setBackgroundRole( QPalette::Button );
m_pWorkspaceDockWidget->setMinimumHeight( 400 );
m_pWorkspaceDockWidget->setMaximumWidth(150 );
m_pWorkspaceDockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);

14th September 2006, 15:06
This is not the answer to my question, I want to have a minimum size, and when in vertical position I want it be the default size, while still having the chance to expand and when it is in horizontal position i want it to have as much space as possible while still having the chance to make it smaller