Qt 是否提供了一种在用户开始和/或停止移动或调整顶级窗口大小时收到通知的方法?
在回答不同的stackoverflow问题正确的解决方案将需要知道QT应用程序的窗口何时被用户的鼠标拖动或调整大小,以免在此期间内移动或调整大小,从而避免“与用户战斗”以控制窗口。
但是,我不知道当用户按下窗口标题栏上的左小鼠按钮,或者之后用户释放左小鼠按钮时,我不知道QT应用程序是否有任何机制。是因为该功能是由OS的窗口管理器而不是QT库来处理的。也就是说,有什么秘密的方法吗?跨平台是最好的,但是特定于OS的解决方案也很感兴趣。
While answering a different StackOverflow question I realized that a 100% correct solution would need to know when the Qt application's window was being dragged or resized by the user's mouse, so that it would refrain from moving or resizing itself during that period, and thereby avoid "fighting with the user" for control of the window.
However, I don't know of any mechanism for a Qt app to be notified when the user pressed down the left-mouse button on the window's title bar, or when the user releases the left-mouse button afterwards... I assume that is because that functionality is handled by the OS's window-manager rather than by the Qt library. That said, is there any secret way to do it? Cross-platform would be best, but OS-specific solution are also of interest.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论