PyQt(Python+Qt)学习随笔:Qt Designer中QAbstractButton派生按钮部件autoRepeat、autoRepeatDelay、autoRepeatInterval属性

autoRepeat、autoRepeatDelay、autoRepeatInterval这三个属性为一组属性,用于控制按钮的按下事件是否重复、重复的频次等。

autoRepeat

如果启用了autoRepeat,则当按钮按下且鼠标未释放时,会定期发出pressed()、released()和clicked()信号。默认情况下,autoRepeat处于禁用状态。autoRepeat处于允许状态时,延迟时间和重复间隔由autoRepeatDelay、autoRepeatInterva以毫秒为单位定义。

可以通过autoRepeat() 、setAutoRepeat(bool)来访问和设置autoRepeat属性。

注意:如果用快捷键按下某个按钮,则系统将启用自动重复并计时,而不是QAbstractButton类来启用。此种情况下,pressed()、released()和clicked()信号将像正常情况一样发出。

autoRepeatDelay

此属性保持自动重复的初始延迟,单位是毫秒。

如果启用了autoRepeat,则autoRepeatDelay定义自动重复开始之前的初始延迟。即首次发送信号之前的延时,也就是在按钮被按下到首次发送信号之间的时间间隔。

可以通过autoRepeatDelay () 、setAutoRepeatDelay (int)来访问和设置autoRepeatDelay 属性。

autoRepeatInterval

autoRepeatInterval属性保存自动重复触发按钮的pressed()、released()和clicked()信号每次之间的时间间隔,单位是毫秒。
可以通过autoRepeatInterval() 、setAutoRepeatInterval (int)来访问和设置autoRepeatDelay 属性。


博客地址:https://blog.csdn.net/LaoYuanPython

老猿Python博客文章目录:https://blog.csdn.net/LaoYuanPython/article/details/98245036

原文地址:https://www.cnblogs.com/LaoYuanPython/p/11931643.html