窗口置顶操作

知识共享许可协议 版权声明:署名,允许他人基于本文进行创作,且必须基于与原先许可协议相同的许可协议分发本文 (Creative Commons

使用setWindowFlags接口设置窗口的WindowStaysOnTopHint属性实现置顶操作。

接口

Qt::WindowFlags windowFlags() const
void setWindowFlags(Qt::WindowFlags type)

窗口置顶

  • 通知窗口系统该窗口应该位于所有其他窗口之上。注意,在X11上的一些窗口管理器上,您还必须传递Qt::X11BypassWindowManagerHint,以使此标志正确工作。
setWindowFlags(windowFlags()| Qt::WindowStaysOnTopHint);

窗口置底

  • 通知窗口系统该窗口应该位于所有其他窗口的底部。
setWindowFlags(windowFlags()| Qt::WindowStaysOnBottomHin);

猜你喜欢

转载自blog.csdn.net/nicai_xiaoqinxi/article/details/92849959
今日推荐