If a dialog is closed/hidden using hide() then this disappears but if mouse is hovered over application icon in task bar then closed dialog is still visible in preview.
If the dialog is closed using X button or cancel then this is not visible in preview.
This can be seen with simple attached example.
Step 1: Start WidgetTest1 via Menu in Mainwindow, than click Abbrechen to to hide
Step 2: move with the mouse in the Taskbar between the two Icons still and you can see the WidgetTest1