PDA

View Full Version : problem in QMenu



wagmare
29th January 2009, 08:56
i use this code to interact a window with a menu pushButton



QMenu* pushMenu = new QMenu(pushButton);
DisplayWindow* displayWindow = new DisplayWindow(pushMenu);
QWidgetAction* pushAction = new QWidgetAction(pushMenu);
pushAction->setDefaultWidget(displayWindow);
pushMenu->addAction(pushAction);
pushButton->setMenu(pushMenu);



displayWindow has two pushButton and one label button ...
the problem is that if the user click outside the pushButton it get closed means the menu pushButton is acting entirely on the displayWindow ..

if the user click on the window it toogles the menu pushButton ... how can i rectify this one ... please help