PDA

View Full Version : QPushButton Double Click?



GeneCode
20th November 2017, 02:14
I want to be able to double click a QPushbutton instead of a single click.

What I tried:


connect(pb, SIGNAL(doubleClicked()), this, SLOT(comBtnPressed()));

Error says "QObject::connect: No such signal QPushButton::doubleClicked()"

I chose QPushButton initially, but for my purpose, you can suggest change to other object if it can make a doubleclick event. Not necessarily be a push button.

Thank you Masters of Qt and C++.:cool:

high_flyer
20th November 2017, 11:19
Error says "QObject::connect: No such signal QPushButton::doubleClicked()"

A quick look to the QPushButton docmentation would have told you there is no such signal.

But you can add a double click handler your self to your derived QPushButton.
Do you know what deriving a class means? (no sarcasm intended. If you don't know, you probably need to learn some basic C++ as this is outside the scope of this forum).
If you do know, you can ask specific questions to help you achieve what you want.