i use this code to interact a window with a menu pushButton

Qt Code:
  1. QMenu* pushMenu = new QMenu(pushButton);
  2. DisplayWindow* displayWindow = new DisplayWindow(pushMenu);
  3. QWidgetAction* pushAction = new QWidgetAction(pushMenu);
  4. pushAction->setDefaultWidget(displayWindow);
  5. pushMenu->addAction(pushAction);
  6. pushButton->setMenu(pushMenu);
To copy to clipboard, switch view to plain text mode 


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