I guess the question is why you want to return a file through data().
Does the code that reacts to your selection changes not have access to your model type? I.e. you can't do something like
m_model->fileForModelIndex(modelIndex);
m_model->fileForModelIndex(modelIndex);
To copy to clipboard, switch view to plain text mode
because you don't have access to m_model as a pointer of your model type?
And you also don't have access to the actual data, as in you can't do
QString filename
= modelIndex.
data(MyRoles
::FilenameRole);
... m_zipFile->file(filename);
QString filename = modelIndex.data(MyRoles::FilenameRole);
... m_zipFile->file(filename);
To copy to clipboard, switch view to plain text mode
because there is no mappable identifier?
Cheers,
_
Bookmarks