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. Resizing widgets in the window having minimumsize

Resizing widgets in the window having minimumsize

Scheduled Pinned Locked Moved Unsolved General and Desktop
resizingwidget resizeminimum sizesizepolicyqt c++
1 Posts 1 Posters 246 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.
  • Swati777999S Offline
    Swati777999S Offline
    Swati777999
    wrote on last edited by
    #1

    Hi All,

    I want to arrange my widgets in the window row-wise with a minimum size so that when the outer window is dragged, the widgets take up the space of the window row-wise (not lower than the minimum dimension).

        int n=4;
        QWidget *myWidget = new QWidget();
        QGridLayout *tableLayout = new QGridLayout();
        QMap<int, QTableWidget *>myTables;
        for (int ii=0;ii<n;ii++)
        { myTables[ii]=new QTableWidget();
          //myTables[ii]->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
          tableLayout->addWidget(myTables[ii],0,ii);
        }
            myWidget->setLayout(tableLayout);
            QMainWindow::setCentralWidget(myWidget);
            myWidget->adjustSize();
    
    

    The following code seems not to be working in this case.

      //myTables[ii]->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
    
    

    Can anyone suggest me how to achieve it?

    “ In order to be irreplaceable, one must always be different” – Coco Chanel

    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