Thanks for the response.
The item is initialized using this line in the constructor, as shown in my first post.
root_item = invisibleRootItem();
root_item = invisibleRootItem();
To copy to clipboard, switch view to plain text mode
At least that's what I think, since invisibleRootItem() seems to return a QStandardItem pointer. In any case, if the problem was that root_item is not initialized, the program would crash much earlier, at the next line, when I use setData() on it.
In any case, I am revising all of this. I managed to get this "someshow" working yesterday, very late (which is why I didn't write back here). But now I get a hierarchy that's different of what I thought it would be.
This models is aimed at representing a remote fs (via [q]ftp) in the fashion of QFileSystemModel for local fs's. But instead of getting something like
filename size permissions
filename size permissions
filename size permissions
filename size permissions
filename size permissions
filename size permissions
filename size permissions
filename size permissions
To copy to clipboard, switch view to plain text mode
I was getting something more like:
filename
- size
- permissions
filename
- size
- permissions
filename
- size
- permissions
filename
- size
- permissions
filename
- size
- permissions
filename
- size
- permissions
To copy to clipboard, switch view to plain text mode
Or something like that. Can't really remember. I really don't get the hang of how trees are handled in Qt.
Before anyone says it: yes, I know I could use a QWidgetTree along with QWidgetTreeItem(s). But I definitely want to implement this in a model fashion, so that I can implement filtering and reuse the view for the directory tree and for the file listing, just like I do with QFileSystemModel.
Again, thank you for taking the time to answer.
Bookmarks