Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Obtain widgets of different size in QTabWidget
Qt 6.11 is out! See what's new in the release blog

Obtain widgets of different size in QTabWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 539 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    a_so
    wrote on last edited by
    #1

    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);
    _pwmTabsTWg->addTab(initGeneralTab(),tr("General"));
    _pwmTabsTWg->addTab(initProsthesisTab(),tr("Prosthesis"));
    _pwmTabsTWg->addTab(initInfoTab(),tr("Info"));
    

    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
    
    mainWidget->setLayout(_layout);
    return mainWidget;
    
    1 Reply Last reply
    0
    • m.sueM Offline
      m.sueM Offline
      m.sue
      wrote on last edited by m.sue
      #2

      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.
      -Michael.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved