只要按下 QPushButton() 就应该做出反应
我在我的程序中使用 QPushButton() 。使用这些按钮我可以旋转我的对象。 到目前为止效果很好。唯一的问题是我必须单击多次才能将对象进一步旋转一点。这有点烦人。是不是有可能只要我按下按钮就会一直按下并且物体会进一步旋转。有函数pressed(),但和clicked()没有区别。
I am using QPushButton() in my programme. With these buttons I rotate my object.
Works fine so far. The only Problem is that i have to click multiple times to rotate the object a little further. This is a bit annoying. Isnt there a possibility that the button will stay pressed as long as I press it and the object will rotate further. There is the function pressed(), but there is no difference to clicked().
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
QAbstractButton 有一个自动重复功能,您可以打开:
这将重复发出 pressed()、released() 和 clicked() 信号。您还可以指定发出信号的频率 (
setAutoRepeatInterval
),以及按钮在开始发出信号之前等待的时间 (setAutoRepeatDelay
)。QAbstractButton has an auto-repeat feature that you can turn on:
This will emit the pressed(), released(), and clicked() signals repeatedly. You can also specify how often the signals are emitted (
setAutoRepeatInterval
), and how long the button waits before it starts emitting them (setAutoRepeatDelay
).