Hello,

I'm looking at an application bug where on Windows, opening a dialogue causes the program to disappear from the alt-tab menu (though not the taskbar). This seems to be a result of the Qt::Tool flag + WS_EX_TOOLWINDOW style being applied to the dialog widget.
The widget hierarchy is QMainWindow->QDialog. Is it expected that applying this flag to a child seems to effect the parent, as far as how Windows handles it? I'd assume this would just prevent this dialog window from showing up in these places. Or am I missing something, or is something tragically wrong with the code/app somewhere?

I tried changing the hierarchy to QMainWindow->QWidget(central widget)->QDialog, with no effect. Making the QDialog a sibling, or removing the Qt::Tool flag does fix the alt-tab issue but is undesirable behavior.

Seemingly relevant snippets:

Qt Code:
  1. MainWin::MainWin(QWidget *parent)
  2. : QMainWindow(parent)
  3. {
  4. ui.setupUi(this);
  5. ...
  6. }
  7.  
  8. void MainWin::doClick()
  9. {
  10.  
  11. QScopedPointer<Poppy> theBox(new Poppy(this));
  12. theBox->setModal(true);
  13. theBox->setWindowState(Qt::WindowActive);
  14. theBox->exec();
  15. }
  16.  
  17. Poppy::Poppy(QWidget *parent)
  18. : QDialog(parent)
  19. {
  20. ui.setupUi(this);
  21. this->setWindowFlags(Qt::Tool);
  22. this->setModal(true);
  23. ui.validationWarning->hide();
  24. // connect slots to signals
  25. ...
  26. }
To copy to clipboard, switch view to plain text mode