Dialogs with "close" button hidden still show "close" in taskbar



  • I'm working with Qt 4.8 in Windows10.

    I was working on a "progress bar" custom QDialog when I noticed that, even though I'm hiding the "close" button in the Dialog's title bar, the Taskbar still shows me a "close" button when I right click on my apps's dialog's icon.

    When closing my Dialog using the right click option in the Taskbar, the Dialog closes, but it's still running in the background.

    Is there a way to hide the "close" button of my Dialog even from the Windows Taskbar? Or is that OS controlled?


  • Qt Champions 2016

    Hello,
    If your dialog is a top level window (which I assume it is, since you see it in the task bar) the window manager may or may not decide to honor the hints you pass it, and may or may not have specific way of handling them. That said, I don't think you can do anything about it, beside trying with a child widget (provided my assumption was correct).

    Kind regards.


  • Moderators

    There's no way to remove that button like there's no way to prevent user from hitting Alt+F4. All you can do is handle the close event and ignore it if you don't want the window to close when requested to do so.



  • Thank you! I'll give it a go.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.