Minimizing (hiding) top window (e.g. QDialog) without affecting the main window



  • What I want:

    1. A floating window like a QDialog (with a Qt::Tool flag set) always staying on top
    2. Minimize or hide it without minimizing the main app along with it

    I changed the top window title buttons via Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint, so the top window shows only the Minimize button (as required). But when I hit it, the main application window gets minimized too. I'm on Linux/X11

    If I make the top window a separate window (with a Qt::Window flag set), it can be minimized without affecting the main app, but it doesn't stay on top if I pass focus to the main window

    The Close button in the top window works in the way I want, but I want to do the same with the Minimize button, removing the Close button completely. Any help will be greatly appreciated

    Thank you



  • Okay, it seems that I was able to get what I wanted by creating the top window without a parent and setting a Qt::WindowStaysOnTopHint flag on it

    Problem solved


Log in to reply
 

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