Qt Centre Forum >
Qt >
Newbie > Applying the horizontal and vertical layouts ensures that the application UI scales
View Full Version : Applying the horizontal and vertical layouts ensures that the application UI scales
robertomason@gmail.com
3rd January 2011, 21:25
I'm newbie with some programming experience. I downloaded QTCreator 2.0.1 on a Ubuntu box. I'm doing the tutorial "Creating a Qt C++ Application" from the from the QT Creator Documentation.
I've created my label, LineEditor and TextBox, Applied both the Vertical and Horizontal Layout as explained on the tutorial, When I compile and execute the program. I drag to increase the main box, The widgets I created don't scale (stretch) like I expected them to.
I'm doing something wrong.:)
Zlatomir
3rd January 2011, 21:35
Show some code... or attach a little sample that replicate the problem you have.
Also are you creating the layouts with Designer or code?
If you use the Designer apply a layout by selecting the "form" in the "background" of the QLabel, QLineEdit and other QWidgets.
If you are creating with code make sure that the layout is properly parented, i meant that you have a QWidget to act as a "form" and this is the parent to layout and this will be the widget you show()...
nroberts
3rd January 2011, 21:36
I'm newbie with some programming experience. I downloaded QTCreator 2.0.1 on a Ubuntu box. I'm doing the tutorial "Creating a Qt C++ Application" from the from the QT Creator Documentation.
I've created my label, LineEditor and TextBox, Applied both the Vertical and Horizontal Layout as explained on the tutorial, When I compile and execute the program. I drag to increase the main box, The widgets I created don't scale (stretch) like I expected them to.
I'm doing something wrong.:)
My guess is that you either didn't set the layout for the window or you didn't add your objects to the layout.
robertomason@gmail.com
4th January 2011, 03:15
Thanks for you quick answer. I was using the Designer. It now works. I selected the Form and I applied the layout to the form.
Thanks
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.