PDA

View Full Version : QDialog and QMenuBar


lutins
28th August 2008, 14:01
How Can is add a QMenuBar Object to a QDialog Object? I know QMainWindow have a method "void setMenuBar ( QMenuBar * menuBar ) " But QDialog Havn't. thx

ktk
28th August 2008, 15:02
You could embed a QMainWindow in the dialog and add the QMenuBar there.
There are probably other solutions, too.

wysota
28th August 2008, 15:02
Well... Basically it's against the rules of good GUI design to have a menu bar in a dialog, so I suggest you reconsider your decision. But if you insist on having it, you have to add it manually to your dialog and place it in the layout like any other widget.

lutins
1st September 2008, 08:42
well thank:) every one...i got this problem by manual add in my inherit class.

jpn
13th September 2008, 15:39
Sorry for late response, but QLayout::setMenuBar() might be useful for this...