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. how to set full screen on mainwindown or use scroll area, cant see all elements
Forum Update on Monday, May 27th 2025

how to set full screen on mainwindown or use scroll area, cant see all elements

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 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.
  • L Offline
    L Offline
    Lightshadown
    wrote on last edited by
    #1

    Hi, im trying to set my main window(1920x1080) size to match the size of the screen but if try to see it on my laptop (1280x800) im unable to see most of the lower elements of my widget, how can i resize the elements of my window? or how should I use an scroll area so i can see all the elements? Im using the follow code to set a minimum size of the screen

    Silo *base = new Silo();   // this is my main window widget
    
    //base->setMinimumSize(1280, 800);
    base->setBaseSize(1280, 800);
    base->resize( base->width(), base->height());
    //base->setMaximumSize(1920, 1080);
    //base->setFixedSize();
    base->setWindowState(Qt::WindowMaximized);
    base->setWindowTitle("SAAS");
    base->setWindowIcon(QIcon("images/Icono_App_Silo_1.png"));
    
    JKSHJ 1 Reply Last reply
    0
    • L Lightshadown

      Hi, im trying to set my main window(1920x1080) size to match the size of the screen but if try to see it on my laptop (1280x800) im unable to see most of the lower elements of my widget, how can i resize the elements of my window? or how should I use an scroll area so i can see all the elements? Im using the follow code to set a minimum size of the screen

      Silo *base = new Silo();   // this is my main window widget
      
      //base->setMinimumSize(1280, 800);
      base->setBaseSize(1280, 800);
      base->resize( base->width(), base->height());
      //base->setMaximumSize(1920, 1080);
      //base->setFixedSize();
      base->setWindowState(Qt::WindowMaximized);
      base->setWindowTitle("SAAS");
      base->setWindowIcon(QIcon("images/Icono_App_Silo_1.png"));
      
      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      @Lightshadown said in how to set full screen on mainwindown or use scroll area, cant see all elements:

      im unable to see most of the lower elements of my widget, how can i resize the elements of my window?

      First, put all elements in a Layout. This lets your window automatically re-size and re-position all elements: https://doc.qt.io/qt-5/layout.html

      or how should I use an scroll area so i can see all the elements?

      Use a scroll area only if you have too many elements and even a layout can't fit them all on a screen.

      If you really want to use it, set the QScrollArea as the central widget of your QMainWindow and then call QScrollArea::setWidget() to put your previous central widget inside the scroll area: https://doc.qt.io/qt-5/qscrollarea.html

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      L 1 Reply Last reply
      2
      • JKSHJ JKSH

        @Lightshadown said in how to set full screen on mainwindown or use scroll area, cant see all elements:

        im unable to see most of the lower elements of my widget, how can i resize the elements of my window?

        First, put all elements in a Layout. This lets your window automatically re-size and re-position all elements: https://doc.qt.io/qt-5/layout.html

        or how should I use an scroll area so i can see all the elements?

        Use a scroll area only if you have too many elements and even a layout can't fit them all on a screen.

        If you really want to use it, set the QScrollArea as the central widget of your QMainWindow and then call QScrollArea::setWidget() to put your previous central widget inside the scroll area: https://doc.qt.io/qt-5/qscrollarea.html

        L Offline
        L Offline
        Lightshadown
        wrote on last edited by
        #3

        @JKSH actually it already had a layout, but the main problem is the main window is bigger than the actual screen and the elements should not move from their respective position i did try using a layout and loocking the position but it creates a mess so i had to erase it, how can i set scroll area with out destroying what i already have? im using Qt Designer, i add images of my design.
        with the 1280x800 i can only see 2/3 of the window

        sistema foto 1.png

        The insperctor
        sistema foto 2.png

        sistema foto 3.png

        Pl45m4P 1 Reply Last reply
        0
        • L Lightshadown

          @JKSH actually it already had a layout, but the main problem is the main window is bigger than the actual screen and the elements should not move from their respective position i did try using a layout and loocking the position but it creates a mess so i had to erase it, how can i set scroll area with out destroying what i already have? im using Qt Designer, i add images of my design.
          with the 1280x800 i can only see 2/3 of the window

          sistema foto 1.png

          The insperctor
          sistema foto 2.png

          sistema foto 3.png

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by
          #4

          @Lightshadown

          Because you dont have any layout, it doesn't resize properly.
          Assign a layout to all container where you now can see the red crossed circle. Then everything will work and resize as expected.
          To achieve the design you have currently, you probably need multiple cascading layouts.


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          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