The PyQt4 QTableWidget has both cellPressed and cellClicked signals. From the name, and the little experimentation I did with them, they appear to do exactly the same thing. Is there a difference between the two?
The PyQt4 QTableWidget has both cellPressed and cellClicked signals. From the name, and the
Share
These signals on cells are not sharply documented (that I can find) but I’d interpret them by analogy with the
pressed,clicked, andreleasedsignals on buttons:pressed means the mouse’s left button’s been pressed down inside the widget,
released means the mouse’s left button’s been released (let up) inside the widget,
clicked means the mouse’s left button’s been pressed, then released (let up), both inside the widget
So if you press the button down inside the widget, hold it down, move the mouse elsewhere, and only then release the mouse’s button, then you should only see the
pressedsignal, but neither of the other two; while anyclickedsignal always implies bothpressedandreleasedhave also been signaled.I believe that normal UI behavior should be to respond to
clickedonly, unless you want to do something special if the button’s pressed and not released for a certain time (i.e., held down for a prolonged time).