hi
im trying to get text and data from column in index number 0 from row that is selected
but i never get the right data im using simple model view treeview with QSortFilterProxyModel proxy to sort the columns and QStandardItemModel as the model

this is the slot function that is triggered on each doubleClicked

Qt Code:
  1. connect(ui.treeView_mainwindow, SIGNAL(doubleClicked( const QModelIndex &)), this,SLOT(tree_itemClicked( const QModelIndex &)));
  2. ....
  3. ...
  4. void MainWindowContainer::tree_itemClicked(const QModelIndex & index)
  5. {
  6. int iSelectedRow = index.row();
  7. QString groupID;
  8. QString groupName;
  9. groupID = m_model->item(iSelectedRow,0)->data(Qt::UserRole).toString();
  10. groupName = m_model->item(iSelectedRow,0)->text();
  11.  
  12. }
To copy to clipboard, switch view to plain text mode