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; videoWindow.setWindowFlags(flags); videoWindow.show(); }
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?
-
oh! so just don't pass the parent window when constructing the tool window! wow!
-
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) ?
-
Hi
QWidget* ToolWin=new QWidget(); // no parent. You must delete your self
ToolWin->setWindowFlag(Qt::Tool);
ToolWin->show();Then it just a normal window that can even fall behind mainwindow and all other
windows. -
oh! so just don't pass the parent window when constructing the tool window! wow!
-
Yeah else it will stay over its parent.
-
Btw this sample is handy to check out the flags
http://doc.qt.io/qt-5/qtwidgets-widgets-windowflags-example.html