removing "Always On Top" flag doesn't work? (Windows)

  • using: Qt Creator 4.4.0
    Based on Qt 5.9.1 (MSVC 2015, 32 bit)

    i see elsewhere code like this:

    		Qt::WindowFlags		flags(videoWindow.windowFlags());
    		flags = (flags & ~Qt::WindowStaysOnTopHint) | Qt::WindowStaysOnBottomHint;	

    which is supposed to remove the "always float above all other app windows", but this simply isn't happening. The window will NOT go behind other windows in the same app, it STILL stays on top.

    What am i missing?

  • even if i do this:

    	SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);

    it STILL floats above all other windows in the app

  • put another way: on Windows (64 bit), how can i create a window that LOOKS like a "Tool" window (smaller title bar), but behaves like a normal window (ie: doesn't hide when app is not front, and doesn't sit on top of / can go behind other windows in the same app) ?

  • Lifetime Qt Champion

    QWidget* ToolWin=new QWidget(); // no parent. You must delete your self

    Then it just a normal window that can even fall behind mainwindow and all other

  • oh! so just don't pass the parent window when constructing the tool window! wow!

  • Lifetime Qt Champion

    Yeah else it will stay over its parent.

  • Lifetime Qt Champion

    Btw this sample is handy to check out the flags

Log in to reply

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