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. Problem with QTabWidget resizing @ runtime
Forum Update on Monday, May 27th 2025

Problem with QTabWidget resizing @ runtime

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 2.7k Views
  • 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.
  • M Offline
    M Offline
    M_31
    wrote on last edited by
    #1

    Hi All,
    I would to like to Expand QTabWidget control where i have 4 tabs on it and i set the TabPosition as East.
    and i embedded the QtabWidget into the RightDockWidgetArea of DockWindow.

    Now where i try to Expand the tabWidegt , the Entire thing is getting expanded, but i want only the TabWidget content page alone expand, not the entire QDockWidget or the Tabs in TabWidget.

    Please let me know ur thoughts.. here is my code.
    Here the TestDlg has the QTabWidget control..

    @
    Void CreateDockWindow()
    {
    QDockWidget *dlgDock= new QDockWidget(this);
    TestDlg *tstDlg= new TestDlg;

        dlgDock->setWidget(tstDlg);
        dlgDock->setAllowedAreas(Qt::RightDockWidgetArea);
        dlgDock->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
        dlgDock->setFeatures(QDockWidget::NoDockWidgetFeatures);
    
        addDockWidget(Qt::RightDockWidgetArea, dlgDock);
    

    @

    1 Reply Last reply
    0
    • M Offline
      M Offline
      M_31
      wrote on last edited by
      #2

      Now i have designed the TabWidget control from Qt designer instead of embedding into the dialog & then into the DockWidget.

      Now i am able to set the properties of each tab expand to fit into the size of the TabWidget..

      But i want to know ...how to expand the size of the TabWidget area at runtime from the mainWindow ..like what we do in Qt Designer..

      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