QPushButton () should respond as long as it is pressed

I am using QPushButton () in my program. Using these buttons, I rotate my object. So far, it works well. The only problem is that I have to click a few times to rotate the object a bit. This is a bit annoying. Is it not possible for the button to remain pressed while I press it, and the object will rotate further. The function is pressed (), but there is no difference in clicking ().

+7
source share
1 answer

QAbstractButton has an auto replay feature that you can enable:

button->setAutoRepeat(true); 

This will repeat the pressed (), released (), and clicked () signals. You can also specify how often signals are emitted ( setAutoRepeatInterval ), and how long the button waits before it starts emitting them ( setAutoRepeatDelay ).

+21
source

All Articles