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
{
QString str
(model
->fileForIndex
(index
));
Phonon::MediaSource src(str);
mediaObject->stop();
mediaObject->setCurrentSource(src);
mediaObject->play();
}
void myTunes::treeDclick(QModelIndex index)
{
QString str(model->fileForIndex(index));
Phonon::MediaSource src(str);
mediaObject->stop();
mediaObject->setCurrentSource(src);
mediaObject->play();
}
To copy to clipboard, switch view to plain text mode
{
int i;
i = index.row();
}
QString mediaLibrary::fileForIndex(QModelIndex index)
{
int i;
i = index.row();
return QString(item(i,0)->text());
}
To copy to clipboard, switch view to plain text mode
when compiled the programme runs fine untill the double click event when the code
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
Bookmarks