Use layouts, then you don't have to do the children resizing by your own: QLayout, QGridLayout...
Use layouts, then you don't have to do the children resizing by your own: QLayout, QGridLayout...
EDITED
ive tried to lay my widget under a grid layout, for some strage reason the app compiled and run ok but i lost connection with my .cpp file, for ex i clicked on a button on my app and nothing happened! lol, when i removed the grid layout everything worked correctly again :P..
ive also tried to right click to my tabwidget and lay out as grid layout, but then i couldnt setup the widgets where i want them to be in the form.. lol...
so lets forget the layout method, i dont have a problem to code all of my widgets in the app to resize automatically as long as i know how to do it...
so please help hehe xD
Last edited by Mystical Groovy; 19th December 2009 at 13:17.
Using QLayout correct don't break any functionality! Let me see some code and I might tell you the error... Just post it here.
hi and thx for the reply
well basically im doing all the form work using the QtCreator's intergrated designer, so i dont have a spesific laying out widgets code on my source file.
I could try to lay my widget in a QLayout using code if this is necessary (im trying to avoid setting up the widgets again via code coz it'll take ages you see )![]()
oh!, i have some button that to be shown, they'll have to be triggered first not done with the designer and layeded out on a QVBoxLayout and QHBoxLayout, maybe thats why it breaks the functionality?
Qt Code:
vbox->addWidget(pkgdesclbl); vbox->addWidget(pkgdescText); vbox->addWidget(pkgfilelistlbl); vbox->addWidget(pkgfilelistText); vbox->addWidget(consoleOutlbl); vbox->addWidget(consoleOutText); hbox->addWidget(pkgsaveBtn); hbox->addWidget(pkgcopyBtn); pkginfoBox->setLayout(vbox); //this is a QFrame in my applications formTo copy to clipboard, switch view to plain text mode
well i managed to lay out the tabwidget in my main window and when i resize the main window the tabwidget resizes along but not the widgets under the tabwidget.
i tried to lay out the widgets inside the tabwidget but as before it messes up my widget potitions and i cant set them in the way i want...
any help please?
ok look, the problem is that i cant get the widgets inside tabwidget in my application resize along with the main window when the user resizes it.
first i tried to do this (as posted in the first post)
Qt Code:
/* i suppose that when the user resizes the window, the height changes so i tried to check it with the following : */ if(!minimumSize().height == 800) //where 800 is the default height for the window { tabwidget->updateGeometry(); // centralWidget->updateGeometry(); // setupUi(this); }To copy to clipboard, switch view to plain text mode
then Lykurg suggested to use layouts, but when i lay the widgets inside my tabwidget in a grid layout it messes the potition of the widgets up and i cant get them to where i want them to be shown.
That's why I ask you to post a screenshot (or better yet a ui file) and we'll help you place them in a layout. It's either that or doing the layout manually by reimplementing resizeEvent() of each and every tab in your window. It's really much quicker to do it with layouts.
here you go mate, thanks![]()
Bookmarks