Ah, yes, thanks, that makes it a lot more clear.
I suspect that the problem is setting fixed/maximum sizes, probably with too small values.
However, I think the whole problem can be avoided by not attempting to shrink QTabWidget, but by using QTabBar and a separated QStackedWidget, combined with a suitable layout, maybe wrapped inside a custom widget.
That way collapsing can be implemented by hiding the stacked widget, expanding should be as simple as showing it again.
Roughly something like
class ExpandTabBar
: public QWidget{
// add the API you would need from QTabWidget
// delegate to m_tabBar and m_stackedWidget as neccessary
private:
};
void ExpandTabBar::setCollapsed(bool collapsed)
{
m_stackedWidget->setVisible(!collapsed);
}
class ExpandTabBar : public QWidget
{
// add the API you would need from QTabWidget
// delegate to m_tabBar and m_stackedWidget as neccessary
private:
QTabBar *m_tabBar;
QStackedWidget *m_stackedWidget;
};
void ExpandTabBar::setCollapsed(bool collapsed)
{
m_stackedWidget->setVisible(!collapsed);
}
To copy to clipboard, switch view to plain text mode
Cheers,
_
Bookmarks