qwidget resize function
-
wrote on 8 Aug 2016, 13:24 last edited by
hello,
Let's say i resize a widget to(700,700) and it's inside a widget that is inside a scroll area why is the size that is set not independant of the screen? on a smaller screen it will set a smaller height...
How can I make it independent? -
Hi,
How did you put that widget inside that other widget inside that scroll area ?
-
wrote on 9 Aug 2016, 13:26 last edited by
@SGaist there is a widget that is the main widget of the mainwindow(called widgettest) inside it there is 5 subwidgets each having a subSubwidget insde them
I tam trying to resize the subSub widgetsscroll = new QScrollArea(this);// seting Main Window as the parent of the widget that contains evrithing this->setCentralWidget(scroll);// setiing that widget as the central widget; scroll->setWidget(ui->widgettest);// widget test is the random widget that contains evrithing scroll->setWidgetResizable(true);// this makes the iwdgets as big as possible
but my question when you resize a widget is with resize(int w, int h) is w and h in pixels? or something else? is the reize independent of the screnn? if I do subsubwidget->resize(500,500); it's always gonna be 500 pixels by 500?
also main window applys a layout to the widgettest and idget test applys a layout to the subwidgets and the subsubwidgets have a layout inside the sub widgets wich delete at run time to resize..
thank you
-
It's in pixel.
QMainWindow doesn't apply any particular layout. It will resize the central widget if you resize the window.
If you want to handle the size of your sub-sub widget by hand, you should not put it in a layout otherwise it's the layout manager that will manage the size and position of it.
-
It's in pixel.
QMainWindow doesn't apply any particular layout. It will resize the central widget if you resize the window.
If you want to handle the size of your sub-sub widget by hand, you should not put it in a layout otherwise it's the layout manager that will manage the size and position of it.
wrote on 10 Aug 2016, 13:28 last edited by@SGaist yes but the thing is that I delete the layout of the sub widget of the subsubwidget and then reaply it after I resize the subsubwidget you think I should not reaplly it? the ting is my subwidget has a minimum size of 1000 pixels I dont understand why on a smaller sccreen it does not take that minimum size and shrinks to 800..
-
@SGaist yes but the thing is that I delete the layout of the sub widget of the subsubwidget and then reaply it after I resize the subsubwidget you think I should not reaplly it? the ting is my subwidget has a minimum size of 1000 pixels I dont understand why on a smaller sccreen it does not take that minimum size and shrinks to 800..
Lifetime Qt Championwrote on 10 Aug 2016, 13:35 last edited by mrjj 8 Oct 2016, 13:35@geor
just a thought
did u call setMinimumH/W on the widget?
1/6