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. How to toggle widget "always on top"

How to toggle widget "always on top"

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 2.7k Views 1 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.
  • C Offline
    C Offline
    crqt
    wrote on last edited by
    #1

    I want to have a child window that is not always on top, which seems to be the default.

    I have tried the following, but it doesn't seem to have any effect.

    @ Qt::WindowFlags flags = dialog->windowFlags();
    dialog->setWindowFlags( flags ^ ( Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint) );@

    Ultimately I only have a parent widget because I can't figure out how to reliably center the child when there is no parent, and this seems like it would have an easier solution.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      crqt
      wrote on last edited by
      #2

      I quickly noticed that i was actually trying to turn it on with the code above.

      Upon further investigation, I found that the flag I was trying to unset isn't set at all in the first place, so unsetting it obviously didn't help.

      Is there a 'right way' to set a widget (dialog) to not stay on top?

      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