如何禁用 Qt 对话框默认按钮通过选项卡导航进行更改

发布于 2024-09-01 16:25:24 字数 149 浏览 1 评论 0原文

在 Qt 4 中,默认情况下,通过 Tab 键切换对话框会将默认按钮更改为 Tab 键切换到的按钮。这使得选项卡看起来有点难看并且分散注意力,因为在选项卡导航期间会发生额外的重绘,从而分散了用户的注意力。

有没有办法禁用此 Qt 功能并保持默认按钮不被选项卡导航修改?

In Qt 4, by default, tabbing through a dialog changes the default button to be the button tabbed to. This makes tabbing look a bit ugly and distracting as extra redraws take place during tab navigation which distract from point of user focus.

Is there a way to disable this Qt functionality and leave the default button unmodified by tab navigation?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

野心澎湃 2024-09-08 16:25:24

QPushButton 的 autoDefault 属性负责此行为。默认情况下它的值为 true。

将所有相关按钮设置为 false 将防止它们在聚焦时成为默认按钮。

QPushButton's autoDefault property is responsible for this behavior. By default it's value is true.

Setting it to false for all relevant buttons will prevent them from becoming default when focused.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文