Hi All,

I am working on a application in which I am having a QMdiArea. In that QMdiArea i have multiple MdiSubWindows. Now when I Right Click a MDi SubWindow I get a PopUp that can can generate one more configuration menu as PopUp. Now My problem is after opening that second configuration menu if I want to activate another MdiSubWindow I have to click it 3 times. On Each Click one popup will go then in third click that MdiSubwindow will get activated. I want to do it in single Click

Now if i do not Open that second PopUp MdiSubwindow do not take 2 Click to get activated. It gets activated in single click.

I have tried doing ClearFocus in leaveEvent() of Mouse but its not helping.

In ui file both popups are Widgets.

Here is constructor of second popup
Qt Code:
  1. DMSControllerCustomizationMenu::DMSControllerCustomizationMenu(QString sourceName, QWidget *parent)
  2. {
  3.  
  4. if ( !_readUIFile())
  5. {
  6. LOG_ERROR("Unable to read the UI File")
  7. return;
  8. }
  9.  
  10. if ( !_initializeWidgets() )
  11. {
  12. LOG_ERROR ("Unable to initialize widgets. Check UI File");
  13. return;
  14. }
  15.  
  16.  
  17.  
  18. setWindowFlags(Qt::Popup);
  19. setParent(parent);
  20.  
  21. hide();
  22.  
  23. _makeConnections();
  24.  
  25. QVBoxLayout *vBoxLayout = new QVBoxLayout();
  26.  
  27. vBoxLayout->addWidget(_customizationWidget);
  28. vBoxLayout->setContentsMargins(0, 0, 0, 0);
  29. vBoxLayout->setSpacing(o);
  30.  
  31. setWindowFlags(Qt::Popup);
  32. // vBoxLayout->addWidget(_interpolationTypeDMSComboBox);
  33. setLayout(vBoxLayout);
  34. }
To copy to clipboard, switch view to plain text mode 


Here for first one..
Qt Code:
  1. if ( !_readUIFile())
  2. {
  3. LOG_ERROR("Reading UI Failed");
  4. return;
  5. }
  6.  
  7. _sourceName = sourceName;
  8. if ( !_initializeWidgets())
  9. {
  10. LOG_ERROR("Unable to initialize widgets. Check UI File");
  11. return;
  12. }
  13.  
  14. _customizationSubWindow = new DMSControllerCustomizationMenu(sourceName, parent);
  15. _customizationSubWindow->setVisible(false);
  16.  
  17. _makeConnections();
  18.  
  19. QHBoxLayout *hBoxLayout = new QHBoxLayout();
  20.  
  21. hBoxLayout->addWidget(_mainInputMenuWidget);
  22. hBoxLayout->setContentsMargins(0, 0, 0, 0);
  23. hBoxLayout->setSpacing(o);
  24.  
  25. setLayout(hBoxLayout);
  26. resize(_mainInputMenuWidget->width(), _mainInputMenuWidget->height());
  27.  
  28. setParent(parent);
  29. setWindowFlags(Qt::Popup);
  30. setFocusPolicy(Qt::ClickFocus);
  31. _menuFadeTimer.setSingleShot(true);
  32. connect(&_menuFadeTimer, SIGNAL(timeout()), this, SLOT(hide()));
  33. hide()
To copy to clipboard, switch view to plain text mode 
;