I want help on getting data from tableView with QSqlQueryModel,

void MyQtApp::selectionChanged(const QModelIndex &index1,const QModelIndex &index2)
{
qDebug("Row:%i Data:%i\n",index1.row(), index1.data(0).toInt() );
}

I get here the value of selected cell of selection row. I want get first column data of selected row.