PDA

View Full Version : why addSeparator() doesn't work on QMenuBar



yxmaomao
29th May 2008, 08:12
Hi guys

I want to add some separator between main menus items
I find there is a function named addSeparator() in QMenuBar, But it doesn't work

Why?

I am using Qt V4.3.2 + Windows XP

Could you give me some clues

Thanks

mazurekwrc
29th May 2008, 08:34
because it doesn't work with all styles, it's work with Motif and CDE styles

ramaro
29th May 2008, 08:44
HI?

Can we see how have you do it?

Do like this :


menubar = new QMenuBar(this);
menubar->setGeometry(QRect(0, 0, 1183, 21));
menu_File = new QMenu(menubar);

menubar->addAction(menu_File->menuAction());
menu_File->addSeparator();