Hi everyone,

I'm using QTableView in a QWidget to show data from database. Users can click any cell in column 3 to play the music in that cell. Therefore I change the cursor to pointing hand when pointer entered the column and change it back to arrow when left.

Here is some related code:
Qt Code:
  1. m_view->setMouseTracking(true);
  2. connect(m_view, SIGNAL(clicked(QModelIndex)), this, SLOT(playAudio(QModelIndex)));
  3. connect(m_view, SIGNAL(entered(QModelIndex)), this, SLOT(changeCursor(QModelIndex)));
  4. connect(m_view, SIGNAL(viewportEntered()), this, SLOT(changeCursor()));
  5.  
  6. void Tab::changeCursor(QModelIndex index){
  7. if(index.column() == 3)
  8. setCursor(Qt::PointingHandCursor);
  9. else
  10. setCursor(Qt::ArrowCursor);
  11. }
  12. void Tab::changeCursor(){
  13. setCursor(Qt::ArrowCursor);
  14. }
To copy to clipboard, switch view to plain text mode 

Everything works well except when I move pointer from column 3 to its header and leave the QTableView, the viewportEntered signal is not emitted and the cursor is keeping pointing hand but not arrow.

Could anyone help me with is issue? I'm using Qt 4.7.
Thanks in advance.