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. Qt Window Size
Forum Update on Monday, May 27th 2025

Qt Window Size

Scheduled Pinned Locked Moved General and Desktop
4 Posts 4 Posters 1.3k 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.
  • J Offline
    J Offline
    Jamiil
    wrote on last edited by
    #1

    Using a Qt widget base application in Qt5.2.1 I would like to display the main window dynamically occupying the whole screen, how can I do that?
    One observation: Not all monitors have the same size, mine is very small compared to the ones at work.
    Thanks in advance

    In reality, when you expect less you’ll be disappointed more. The lower you aim, the less fulfilling your life will be.

    1 Reply Last reply
    0
    • N Offline
      N Offline
      nicky j
      wrote on last edited by
      #2

      This works for a QMainWindow
      @this->setWindowState(Qt::WindowFullScreen);@
      I'm not sure if it will work for a QWidget, but you can try it out

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ankursaxena
        wrote on last edited by
        #3

        May it looks some bad. but In qt 4 main window can occupy whole screen.

        QDesktopWidget desktop;

        int vnWidth=desktop.geometry().width();
        int vnHeight=desktop.geometry().height();

        this->setFixedSize(vnWidth,vnHeight);

        1 Reply Last reply
        0
        • M Offline
          M Offline
          marstay
          wrote on last edited by
          #4

          If you want a full screen widget you had to do

          @widget->setWindowFlags(Qt::WindowStaysOnTopHint|Qt::FramelessWindowHint);@

          and after that call @widget->showFullScreen();@

          Also you can try the @this->setCentralWidget(widget);@ for the main window.

          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