I'm trying to create a level editor with re-implemented QTableWidget and QTableWidgetItem.

The thing is, I want to implement the mouse events such that the Middle Mouse Button corresponds to selection instead of the Left Mouse Button (so that the left mouse button only places the tiles). I want to do this with a ContiguousSelection Selection Mode.

I really haven't been able to figure this out. I know in my re-implementations of mousePressEvent and mouseMoveEvent I can setSelection (even with this approach, I dunno how to set the QRect for a single item selection), but I want to know if there is a better way.

Thanks for your help!