Reputation: 113385
I want to have an undecorated window that will stay in the background of all windows.
For this I apply two window flags to a this Qt window: Qt::FramelessWindowHint
and Qt::WindowStaysOnBottomHint
.
If I apply only first flag it will undecorate my window. If I apply only the second flag I will have a window that is not undecorated but stays in the background of all windows.
I cannot understand why if I apply both flags I have two situations:
If the order is:
view->setWindowFlags(Qt::WindowStaysOnBottomHint);
view->setWindowFlags(Qt::FramelessWindowHint);
I have a window that is undecoraded but doesn't stay on background.
If the order is:
view->setWindowFlags(Qt::FramelessWindowHint);
view->setWindowFlags(Qt::WindowStaysOnBottomHint);
I have a window that is NOT undecoraded but stays on background.
How can I create a window that stays in background and is undecorated?
Upvotes: 1
Views: 1936
Reputation: 7429
Without knowing anything about Qt I guess what you might want is:
view->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnBottomHint);
Flags are often just implemented as integers with certain bits set and bitwise or
is used to set multiple bits of a flag.
Upvotes: 4