Setting multiple size to qtabbar
-
Sure. You have to create your own subclass of QTabBar, where you override tabSizeHint, something like this:
@
class TabBar : public QTabBar
{
Q_OBJECT
public:
explicit TabBar(QWidget *parent = 0) :
QTabBar(parent)
{
}protected:
QSize tabSizeHint(int index) const
{
QSize hint = QTabBar::tabSizeHint(index);if (index == 0) return QSize(100, hint.height()); else return hint; }
};
@To make your tab widget use it, I think you have to subclass QTabWidget as well, something like this:
@
class TabWidget : public QTabWidget
{
Q_OBJECT
public:
explicit TabWidget(QWidget *parent = 0) :
QTabWidget(parent)
{
setTabBar(new TabBar);
}
};
@This will make the first tab of a TabWidget have width 100.