Obtain widgets of different size in QTabWidget

  • I have a QTabWidget item that implements 3 different pages. The layout of the third one is bigger which adds to my other pages some margins to achieve the same size. My question is how can I get pages with different size?

    This is how I implement the pages in the constructor:

    _pwmTabsTWg = new QTabWidget(this);

    This would be how I call my widget in e.g. initInfoTab()

    QWidget *mainWidget = new QWidget(this);
    QVBoxLayout *_layout= new QVBoxLayout(this);
    //define and add widgets to layout
    return mainWidget;

  • Hi,
    I would say that you should not do this even if it were possible.
    This would make the tab widget shrink (or enlarge) depending on the tab that you press. As a user of your tabwidget, this may make a tab that represents a small widget and which I've just pressed at the right border of your tabwidget vanish from under my mouse pointer when the tabwidget shrinks, which would highly irritate me.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.