PDA

View Full Version : Applying Layouts causes screen mess-up



mpp03
15th November 2010, 20:00
Hi,

I am new to Qt4 and am having troubles understanding the Layout component.

I wish to have my screen in the layout as in the attached screen shot (client-screen.png).

This screen is based upon a 800x600 screen layout, which I would like to have as the default size. If the user increases the screen resolution to a larger size, I would like the screen components to adjust accordingly. This I understand is what Layouts are for.

I have tried every layout in the designer, including splitters, and every time I apply a designer change, it messes up my layout; I am unable to rectify the layout changes, so I "undo" the applied layout. I am sure there is a way to get the layout to work, I just need some help in doing this.

Can you please see my attached source (testclient.zip) and/or the screen shot and give me advice on how to apply layouts so that my screen will continue to look nice.

Many thanks in advance,
Michael

ChrisW67
15th November 2010, 21:21
Apply a layout to the main window: try a grid layout. Remove the fixed size policy from the list and table widgets. Apply layout to some of the subordinate widgets. Layouts can only work if you use them.

Using Layouts in Qt Designer (http://doc.trolltech.com/4.7/designer-layouts.html)
Layout Management (http://doc.qt.nokia.com/4.7/layout.html)

mpp03
15th November 2010, 23:14
Thank you ChrisW67,

I appreciate the links and will take the advice. I do hope that I can get this working; I like QT as a screen and UI designer; it works a lot like Delphi, with which I am familiar.

Again, thank you for your advice and UI file.

Michael

wysota
16th November 2010, 00:25
BTW. It's "Qt" and not "QT". The latter is a technology of the Fruit Company.

mpp03
22nd November 2010, 14:56
ChrisW67 & wysota,

Thank you very much for your replies and help. The UI file did the trick and the client is very happy with the result.

As well, I will remember that it is Qt, not "QT".

Cheers,
Michael http://www.qtcentre.org/images/smilies/cool.png