Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to set window size?
Qt 6.12 LTS is out! See what's new in the release blog

How to set window size?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 605 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.
  • T Offline
    T Offline
    TheCeylann
    wrote on last edited by
    #1

    I created a QTableView, when I press the button and open this table, it appears as a small box. How can I adjust the size of my window?

    QTableView *view = new QTableView;
       view->setFont(fnt);
    
      view ->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
    
    Christian EhrlicherC M 2 Replies Last reply
    0
    • T TheCeylann

      I created a QTableView, when I press the button and open this table, it appears as a small box. How can I adjust the size of my window?

      QTableView *view = new QTableView;
         view->setFont(fnt);
      
        view ->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
      
      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @TheCeylann said in How to set window size?:

      How can I adjust the size of my window?

      1. use layouts
      2. see QWidget::resize()

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • T TheCeylann

        I created a QTableView, when I press the button and open this table, it appears as a small box. How can I adjust the size of my window?

        QTableView *view = new QTableView;
           view->setFont(fnt);
        
          view ->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
        
        M Offline
        M Offline
        mpergand
        wrote on last edited by mpergand
        #3

        @TheCeylann
        Set a minimum size to the tableView.

        Or better: save and restore the table geometry in QSettings the user wants.

        1 Reply Last reply
        1

        • Login

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