QToolButton:按下回车键时单击
我必须将 QPushButton 更改为 QToolButton。我使用 QPushButton 的 setDefault() 和 setautoDefault() 选项在按下 Enter(返回)时单击按钮,但现在我找不到对 QToolButton 执行相同操作的方法。
有什么建议我可以解决这个问题吗?
I had to change a QPushButton to a QToolButton. I used the setDefault() and setautoDefault() options for the QPushButton to click the button when enter(return) pressed but now I cant find a way to do the same with the QToolButton.
Is there any advice how I can solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您由于某种原因被迫使用 QToolButton 而不是 QPushButton,那么这些方法将不再可用。您需要手动连接来自其他小部件的信号才能触发按钮的点击。
If you are for some reason forced to use a QToolButton instead of QPushButton, then those methods are no longer available to you. You would need to manually hook up signals from the other widgets to trigger a click on your button.