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 Layout equal to MainWindow
Qt 6.11 is out! See what's new in the release blog

Resizing Layout equal to MainWindow

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 822 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.
  • A Offline
    A Offline
    amarism
    wrote on last edited by
    #1

    When I run my program it will display all content properly, and when I resizing the main window, the layout along with all associated widgets remain fixed, rather than resizing with the main window. I used to increase my all widget and listWidget respect to window computer resolution size but still this one work properly.
    I used this one code finding the system height and width.
    QWidget widget;
    widget.resize(widget.width(), widget.minimumHeight());
    QRect rec = QApplication::desktop()->screenGeometry();
    int h = rec.height();
    int w = rec.width();
    // Increasing the listwidget size
    ui->listWidget->setFixedHeight(h);
    ui->listWidget->setFixedWidth(w);
    //increasing the button size
    ui->pushButton->setFixedHeight(h0.2);
    ui->pushButton->setFixedWidth(w
    0.2);

    Please resolve to solve my problem. Thanks very much in advance.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Moderators Qt Champions 2024 Qt Champions 2022 Qt Champions 2017
      wrote on last edited by
      #2

      Looks like you are using the designer to write the UI. I suspect that you have not added the layout properly. Can you confirm whether base class is QMainWindow or Widget ? Are you applying the layout properly in Designer to top widget ?

      Dheerendra
      @Community Service
      Certified Qt Specialist
      https://www.pthinks.com

      1 Reply Last reply
      2

      • Login

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