mbjerkne
24th January 2006, 18:49
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?
void MyTable::mouseMouseEvent(QMouseEvent * event)
{
if ( event->button() == Qt::LeftButton )
{
std::cout << "mouse moved" << std::endl;
}
QTableWidget::mouseMoveEvent(event);
}
i.e. this code does not produce any output. I have tried turning mouse tracking on, with no luck. Any suggestions?
void MyTable::mouseMouseEvent(QMouseEvent * event)
{
if ( event->button() == Qt::LeftButton )
{
std::cout << "mouse moved" << std::endl;
}
QTableWidget::mouseMoveEvent(event);
}