PDA

View Full Version : QDialog 'central widget' layout



jon@tsdmedia.com
13th September 2011, 01:32
Hi to all,

If I create a Qt project using Qt Creator and select the base class to be a QDialog a project is dutifully created and the dialog shows up in the project object box, and the icon displayed there is some type of layout type icon with a 'red slashed circle, over laying it.

6841

My question is "How do I morph the dialog box to have a root layout of QHBox or QVBox layout? The only selection availbe for the layout is adjust size. So how to activate the deactivated layout.

If I build a new project using 'Qt Designer Form' and use QDialog as the base class then I can select Layout->Layout horizontally for instance, and the QDialog object icon is not over layed with the red slashed circle. But there is no project file or main.cpp created.

6840

Its straight forward enough to create a .pro file and a main.cpp and turn the whole thing into a project, but I think there must be a better way and I have not been able to find it.

The difference between the two different dialogs is the in the first case objects(buttons, other layout, etc) do not scale as the dialog window size is adjusted. In the second case since the base dialog layout is not , uh disabled for want of a better term , all the form objects scale then the dialog window size is adjusted.

Hopefully someone can clear up this conundrum for me.

Thanks

Jon

high_flyer
13th September 2011, 13:59
My question is "How do I morph the dialog box to have a root layout of QHBox or QVBox layout? The only selection availbe for the layout is adjust size. So how to activate the deactivated layout.
In designer, click in the dialog (focus it), and then click on the desired layout button above in the toolbox.
Thats it.

jon@tsdmedia.com
13th September 2011, 16:10
OK, it's funny sometimes how you can be so perplexed and yet the solution is so simple.
Danke high_flyer,
jon