QTabWidget - problem with resizing
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??
Re: QTabWidget - problem with resizing
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?
Re: QTabWidget - problem with resizing
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.
Re: QTabWidget - problem with resizing
Does anyone have any clue how to solve this?
Re: QTabWidget - problem with resizing
if you want small size then use setMaximumWidth() or setMaximumSize().
here I am pasting my application code:
[html]
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();
[/html]
Re: QTabWidget - problem with resizing
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