Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Dialogs with "close" button hidden still show "close" in taskbar
Qt 6.11 is out! See what's new in the release blog

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 2.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • cgripeosC Offline
    cgripeosC Offline
    cgripeos
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by kshegunov
      #2

      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.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      1
      • Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by Chris Kawa
        #3

        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.

        1 Reply Last reply
        0
        • cgripeosC Offline
          cgripeosC Offline
          cgripeos
          wrote on last edited by
          #4

          Thank you! I'll give it a go.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved