Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在编写一个驻留在托盘中的应用程序,当用户左键单击它时显示一个窗口(未装饰,并根据 StatusIcon 定位)。
在我运行应用程序并单击图标后,窗口显示正确,但在隐藏 (set_visible(false)) 并重新显示后,我得到一个空白窗口。
我已经尝试了很多事情(我不记得了:/)但没有解决。
代码;TrayIcon::on_button_release 是通过 set_visible 显示和隐藏窗口的位置
set_visible() 是围绕 show() 和 hide() 的便利。show() 保证只有当前小部件变得可见,而不是它的子部件。您可能想调用 show_all() 以递归方式显示所有内容。