PDA

View Full Version : QTabWidget - problem with resizing



moowy
12th September 2006, 16:41
Hello

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.
example:
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??

gfunk
12th September 2006, 18: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?

moowy
13th September 2006, 09: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:
setMinimumSize(202,265);
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.

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

rajesh
14th September 2006, 13: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);
m_pWorkspaceDockWidget->adjustSize();

moowy
14th September 2006, 14: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