Hi,
I have QFileSystemModel and I want to store some additional data in each index.
I used setData function like as
model.setData(index, "additional data", Qt::UserRole);
model.setData(index, "additional data", Qt::UserRole);
To copy to clipboard, switch view to plain text mode
but when I try take these custom data by means of command
qDebug()<< model.index(0, 0, parent).data(Qt::UserRole);
qDebug()<< model.index(0, 0, parent).data(Qt::UserRole);
To copy to clipboard, switch view to plain text mode
it return invalid QVariant, why? QFileSystemModel does not contain container for custom data? If not then I have to inherit from file system model and store it myself?
For example inside my custom delegate if index represents file I need take size of that file. If index represents folder I want take count of files inside this folder and some more information. How I can this done?
Regards,
Bookmarks