QTableView clicked() not triggering when dragging and selecting a range of data in the table?
-
@R-P-H Mouse click means that mouse button was pressed AND released over same widget. Pressing mouse button down over one widget and releasing it over another isn't a click.
You can use https://doc.qt.io/qt-6/qabstractitemview.html#pressed -
@R-P-H
No, because as @jsulm wrote you are not clicking. A click is a mouse down and up while on a cell. But you don't do that, do you? You mouse down and then drag-move the mouse while still down without up, don't you? Which is why he gave you a reference topressed()
signal instead. And you can't have one signal for "both the click and drag" even if "click" is "press" because they happen at different times. Or, doubtless you can re-implement drag-selection yourself and do what you want there, but can't believe it's worth the effort or a good idea. -
@jsulm said in QTableView clicked() not triggering when dragging and selecting a range of data in the table?:
@R-P-H Mouse click means that mouse button was pressed AND released over same widget. Pressing mouse button down over one widget and releasing it over another isn't a click.
You can use https://doc.qt.io/qt-6/qabstractitemview.html#pressedpressed()
worked for me. Thanks !