QTableWidget mouseMoveEvent
I have a class that is a QTableWidget, and I want to be able to select a row and raise/lower it within the table. I was going to reimplement mouseMoveEvent in combination with a keyboard key or maybe the right mouse button, but I have not been able to get any mouse move events from the method.
i.e. this code does not produce any output. I have tried turning mouse tracking on, with no luck. Any suggestions?
Code:
{
if ( event->button() == Qt::LeftButton )
{
std::cout << "mouse moved" << std::endl;
}
}
Re: QTableWidget mouseMoveEvent
I'm not sure but maybe you have to install the eventfilter like this:
MyTable->installEventFilter(this);
Re: QTableWidget mouseMoveEvent
MyTable->setMouseTracking(true);
MyTable->viewport()->setMouseTracking(true);