connect(tableView, SIGNAL( clicked( const QModelIndex & )), this, SLOT( receviedIndex( const QModelIndex & ) ));
void mainwindow::receviedIndex( const QModelIndex &index )
{
// QModelIndex index already references the data as a QVariant
qDebug() << index.data();
qDebug() << "index col: " << index.column();
qDebug() << "index row: " << index.row();
}
|
Ref :
http://www.qtforum.org/article/33855/index-value-from-qtableview-by-clicking.html
沒有留言:
張貼留言