请问如何使Qt窗口置顶的同时,不覆盖任务栏?

TinyKiecoo 2025-01-07 02:12:11

GPT说Qt::Tool类型不会覆盖任务栏,但依然覆盖了。

想要实现的效果:

直接置顶的效果:

 第二张图点击任务栏就能成第一张图的效果,但再点一下模型,就又上来了。

 换句话说想让这个窗口在所有其他窗口之上、任务栏之下。

不论使Qt还是Win32,置顶都置于了任务栏之上。

救救孩子吧,谢谢大佬们!! 

 

...全文
71 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复

置顶就是会覆盖任务栏, 但可以重写相关事件虚函数,使窗口在移动到任务栏的时候调整窗口高度,实现不覆盖任务栏的效果

赵4老师 01-07
  • 打赏
  • 举报
回复

SystemParametersInfo
The SystemParametersInfo function queries or sets systemwide parameters. This function can also update the user profile while setting a parameter.

BOOL SystemParametersInfo(
UINT uiAction, // system parameter to query or set
UINT uiParam, // depends on action to be taken
PVOID pvParam, // depends on action to be taken
UINT fWinIni // user profile update flag
);

Parameters
uiAction
Specifies the systemwide parameter to query or set. This parameter can be one of the following values: Value Meaning

SPI_GETWORKAREA Retrieves the size of the work area on the primary display monitor. The work area is the portion of the screen not obscured by the system taskbar or by application desktop toolbars. The pvParam parameter must point to aRECT structure that receives the coordinates of the work area, expressed in virtual screen coordinates.

16,729

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧