简体   繁体   English

Qt :: WindowStaysOnBottomHint和无框架标志使我的Qt窗口不能保持在所有窗口的底部

[英]Qt::WindowStaysOnBottomHint and frameless flag makes don't keep my Qt window on bottom of all windows

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 . 为此,我将两个窗口标志应用于此Qt窗口: Qt::FramelessWindowHintQt::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: 我不明白为什么如果我同时应用两个标志我有两种情况:

  1. 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. 我有一个未除去的窗口但不留在后台。

  2. 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? 如何创建一个保留在后台并且未装饰的窗口?

Without knowing anything about Qt I guess what you might want is: 在不知道Qt的任何事情的情况下,我想你可能想要的是:

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. 标志通常只是实现为具有某些位设置和bitwise or整数, bitwise or用于设置标志的多个位。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM