big4mil
12th November 2010, 18:29
Hi All,
I would like to change the mouse cursor when I move the mouse pointer inside my QTableView over a row.
I've tried this:
void QTableView::mouseMoveEvent( QMouseEvent *pEvent )
{
int iRow = this->rowAt( pEvent->y() );
if( iRow == -1 )
{
this->setCursor( QCursor( Qt::ArrowCursor ));
}
else
{
this->setCursor( QCursor( Qt::PointingHandCursor ));
}
}
But this unfortunately this does not work. The mouse cursor is not changing. What do I wrong? Any ideas?
Many thanks and best regards
I would like to change the mouse cursor when I move the mouse pointer inside my QTableView over a row.
I've tried this:
void QTableView::mouseMoveEvent( QMouseEvent *pEvent )
{
int iRow = this->rowAt( pEvent->y() );
if( iRow == -1 )
{
this->setCursor( QCursor( Qt::ArrowCursor ));
}
else
{
this->setCursor( QCursor( Qt::PointingHandCursor ));
}
}
But this unfortunately this does not work. The mouse cursor is not changing. What do I wrong? Any ideas?
Many thanks and best regards