ok i may be being thick here but i have a problem.
i subclassed QStandardItemModel for my app, and have set up a model with 4 columns. when i read a list of items from a file it adds the rows in arraying the items in the correct order. that is File, Title, Artist, Album. now when i double click on the treeview it calls the following code

Qt Code:
  1. void myTunes::treeDclick(QModelIndex index)
  2. {
  3. QString str(model->fileForIndex(index));
  4. Phonon::MediaSource src(str);
  5. mediaObject->stop();
  6. mediaObject->setCurrentSource(src);
  7. mediaObject->play();
  8. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. QString mediaLibrary::fileForIndex(QModelIndex index)
  2. {
  3. int i;
  4. i = index.row();
  5. return QString(item(i,0)->text());
  6. }
To copy to clipboard, switch view to plain text mode 

when compiled the programme runs fine untill the double click event when the code
Qt Code:
  1. return QString(item(i,0)->text());
To copy to clipboard, switch view to plain text mode 
creates an error and the debugger halts the programme execution. so my question is why??? and how do i get around it???

as there are no errors shown i cant post them. any help would be very much appreciated.

ta janorcutt