N
N
nvlveu2020-11-13 23:24:32
PyQt
nvlveu, 2020-11-13 23:24:32

How to track for each button its clamping and releasing?

Each button is a separate class in which a QPushButton is created. For each object, you need to track the clamping and releasing of the widget itself or the mouse button. How to implement it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nvlveu, 2020-11-14
@nvlveu

Well, yes. Certainly. First you should have asked, and then looked at the documentation ...
If someone needs it:

# Сигналы зажатия кнопки.
self.button.pressed.connect(self.pressed_)
# Сигналы отпускания кнопки.
self.button.released.connect(self.release_)

B
bbkmzzzz, 2020-11-14
@bbkmzzzz

Catch the mousePressEvent(QMouseEvent *event) and mouseReleaseEvent(QMouseEvent *event) events of the QWidget descendant , which is QPushButton

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question