PDA

View Full Version : Qt Designer - creating a form that includes a menu bar only.



nleverin
3rd July 2007, 08:48
Hi,

Does anyone know if you can create a mainform using Qt3 Designer that includes a height equal to zero. (i.e. all i want is a form that includes the menu bar and no body).

I have tried setting minimum height to zero and then setting preferred height to minimum in the form properties but this did not solve the problem.

I was thinking i may have to code up this form outside Qt designer but was just checking in case someone had encountered this and solved this problem previously,

Thanks in advance,

nlev.

wysota
3rd July 2007, 09:01
What is the point of creating such a form?

nleverin
3rd July 2007, 09:05
Porting a legacy motif application to qt, not sure why they did it this way,

I have tried manually setting the height in the .ui xml file to zero but i think it may be a qt designer limitation?

wysota
3rd July 2007, 11:23
I suggest you do it the proper way instead of forcing odd design.

nleverin
4th July 2007, 16:41
coding by hand i have made a QMainWindow dialog and used the widget class public method "setFixedHeight()" to set the height = 0, (which half worked, ie there is a small area below the menu bar) and "setFixedWidth()"(which did not work, ie goes to a max limit, but window can still be shrunk thinner)

Is there other way to keep only the menu bar, and no area below the menu bar?

wysota
4th July 2007, 17:06
Yes. Use QMenuBar instead of QMainWindow.

nleverin
5th July 2007, 03:00
Ah ha, thank you very much, worked perfectly!!!

cheers heaps for your help, im a newbie to Qt and C++, so your help is very appreciated.

nlev.