Hello Everyone..

i've created a QStandardItemModel named userModel that goes to userTreeView and a slot: getSelectedUser(const QModelIndex &index),which listens to the default signal: clicked(const QModelIndex &index).This is the implementation of the getSelectedUser function:
----------------------------------------------------------------------------------
void MainWindow::getSelectedUser(const QModelIndex &index)
{
QStandardItem *user=userModel->itemFromIndex(index);
}
---------------------------------------------------------------------------------

..and the connection in the MainWindow:

---------------------------------------------------------------------------------
connect(userTreeView, SIGNAL(clicked(QModelIndex)),this, SLOT(getSelectedUser(QModelIndex)));
---------------------------------------------------------------------------------
the signal works fine and the index takes the column and row of the clicked point but the QStandardItem *user gives 0x0 in the debugger..

I would appreciate any help.

(p.s in the end the getSelectedUser function will have to retun a QString -now is void for debugging-..so if anyone knows how to get the QString right away instead of the QStandardItem, it would be great)

Thanks