PDA

View Full Version : QDialog in the taskbar (Win32)



Arthur
26th January 2006, 17:15
Hello,

I have a QDialog, that is shown modal using QDialog::exec(). On my Win32 system, I get an item in the taskbar for this dialog. I always believed that if you set your mainwindow as a parent, this taskbar item dissapears.

I do the following:



QWinWidget winWidget(hWndMain); //WinWidget containing my Win32 mainwindow HWND

QMyDialog dlg(&winWidget); //My dialog, a child of winWidget
dlg.exec();


Is there any other way of hiding the taskbar item for my QDialog?

axeljaeger
26th January 2006, 22:40
Could you try to remove the system menu from your dialog? I remember that I have read something that a taskbar entry only appears when a certain element from the titlebar is visible . You can hide the system menu by removing Qt::WindowSystemMenuHint

from windowFlags:

http://doc.trolltech.com/4.1/qwidget.html#windowFlags-prop

Arthur
27th January 2006, 11:35
It doesn't make a difference.

Daniel
23rd February 2006, 03:12
Any update on this topic?

I have a QWidget that I don't want to appear in the Taskbar. For a while I was using the Qt::Tool flag, but that can have weird effects when you try to use -that- widget as a parent of QDialogs (possibly of all widgets)?

Anyway, I tried using the Qt::WindowSystemMenuHint as mentioned above and it did not work for me either.

Thanks,
Daniel

Arthur
28th February 2006, 17:34
My problem was forgetting to pass the pointer to the mainwindow to the QDialog constructor, like this

<code>

QMyDialog(QWidget * pParent) :
QDialog(pParent)
</code>

In stead, I passed NULL, which is not so smart of course...