Unsolved How to set a Slot receiving every Widget action
-
I'm trying to arrange a slot able to "capture" every event happened related to pressed pushbuttons and Qmouse events on my widgets.
For QMouse events I solved, since all MousePressEvent are captured from the same function; what I'm looking for is how to "capture" every buttons whatever it is.
It seems to be QCoreApplication::notify a good way to make it, but I don't know how to set it.
Any suggestion? -
Hi,
What about keyPressEvent ?
-
This won´t answer your question but what about subclass
QWidget
and reimplementvirtual bool event(QEvent * event)
-
@SGaist
KeyPressEvent is for keyboard only OR for QPushButtons too? -
keyPressEvent reacts to keyboard related events. QPushButton doesn't generate any key event (it receives them though)
-
Is there an common event generated from QPushbuttons, QDials, QSliders,etc...?
-
What kind of event are you interested in ?
-
@SGaist
I've to detect every pressed Pushbuttons, Qdial actions, QSliders and Qmouseevent (this last already done), in order to do "something" when one of the cited elements act. My app is intended for the use in an embedded system connected to a touchscreen LCD display. When the user touches LCD OR press any Button, I've to activate a slot. My problem is I don't know what kind of signal common to all my widgets (if exists) , can be used. -
There's no common signal/event to every widget. You have to implement that tracking yourself.
-
target->installEventFilter(this);