how to set full screen on mainwindown or use scroll area, cant see all elements
-
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"));
-
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"));
@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 -
@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@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 windowThe insperctor
-
@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 windowThe insperctor
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.