I want to implement a file explorer list in the form of a windows form.
-
What is the AbsoluteProxyModel ?
-
@PaNi
AQSortFilterProxyModelis a specializedQAbstractProxyModelwhich provides sorting and/or filtering behaviour on the source model. If you want either/both of those then by all means use a QSFPM, if not use something else derived from QAPM, including possibly something you write yourself.From your description I'm not convinced QSFPM is relevant to your question. Sorting is not an issue you mention. Filtering is used to reduce the source model items. But you are saying (I think) you want to add additional elements over what
QFileSystemModelis supplying? So reducing is not your objective. -
@PaNi
AQSortFilterProxyModelis a specializedQAbstractProxyModelwhich provides sorting and/or filtering behaviour on the source model. If you want either/both of those then by all means use a QSFPM, if not use something else derived from QAPM, including possibly something you write yourself.From your description I'm not convinced QSFPM is relevant to your question. Sorting is not an issue you mention. Filtering is used to reduce the source model items. But you are saying (I think) you want to add additional elements over what
QFileSystemModelis supplying? So reducing is not your objective.@JonB
Thank you for contacting me, JonB. Sorry for the late reply.
Yes, that's right. However, when I searched, I was told that I had to add it using the two proxy models, maybe because I got the wrong keyword.
Currently, the drive output is successful using the QFilesystemModel, but the virtual folder should be envisioned above, just like Window File Explorer. But I understand that it is difficult to implement a Windows virtual folder.
So I think we should go in the direction of adding row and adding rootpath, but I'm a beginner, so I'm not sure how to get it out even if I'm thinking about how to design it. -
@JonB
Thank you for contacting me, JonB. Sorry for the late reply.
Yes, that's right. However, when I searched, I was told that I had to add it using the two proxy models, maybe because I got the wrong keyword.
Currently, the drive output is successful using the QFilesystemModel, but the virtual folder should be envisioned above, just like Window File Explorer. But I understand that it is difficult to implement a Windows virtual folder.
So I think we should go in the direction of adding row and adding rootpath, but I'm a beginner, so I'm not sure how to get it out even if I'm thinking about how to design it. -
-
@JonB
So I searched that way, but the qt version I am using is not supported, so I am looking for another way...crying -
@PaNi
SinceQAbstractProxyModelis available in every version of Qt I don't know what you searched. -
@JonB
Oh! Is that possible? I listened to SGaist and searched for related keywords and found a model other than QAbstractProxyModel. That's why I said that@PaNi
QAbstractProxyModelis there for you to subclass/derive from. You need to first write a class to deliver the "extra"/"virtual" nodes you want (probably deriving fromQAbstractItemModel). Then you might derive from aQAbstractProxyModelto "merge"/"combine" this model with the existingQFileSystemModel, to "augment" it for the (top-level?) nodes provided by your extra/virtual nodes, so that they are presented as a single, combined model to be used by e.g. aQTreeView. -
@PaNi
QAbstractProxyModelis there for you to subclass/derive from. You need to first write a class to deliver the "extra"/"virtual" nodes you want (probably deriving fromQAbstractItemModel). Then you might derive from aQAbstractProxyModelto "merge"/"combine" this model with the existingQFileSystemModel, to "augment" it for the (top-level?) nodes provided by your extra/virtual nodes, so that they are presented as a single, combined model to be used by e.g. aQTreeView. -
KDE has several model classes, one of which concatenates the rows of several other models.
-
KDE has several model classes, one of which concatenates the rows of several other models.
-
Support which feature ?
-
@SGaist
I'm trying to implement it in a different way because the version I'm writing is not the one that supports that feature. The proxy model is hard to access, so I'm trying to implement it using widgets.@PaNi said in I want to implement a file explorer list in the form of a windows form.:
I'm trying to implement it in a different way because the version I'm writing is not the one that supports that feature.
The question is: what feature that is not supported in Qt 5.12 are you talking about?
The proxy model is hard to access, so I'm trying to implement it using widgets.
There is little connection between "proxy models" and "widgets". It is hard to imagine what could be accessed from widgets that would resolve a need for proxy models.
-
@PaNi said in I want to implement a file explorer list in the form of a windows form.:
I'm trying to implement it in a different way because the version I'm writing is not the one that supports that feature.
The question is: what feature that is not supported in Qt 5.12 are you talking about?
The proxy model is hard to access, so I'm trying to implement it using widgets.
There is little connection between "proxy models" and "widgets". It is hard to imagine what could be accessed from widgets that would resolve a need for proxy models.
@JonB
Oh! Not in the version meant that the proxy model that combines multiple rows for the KDE model supports from version 5.13 and the widget implementation is that I can't understand the proxy model at all, so I'm only trying to build a folder tree using TreeWidget.
So we're trying to set the desired address value so that a tree can be created from a folder for that address.
But even that's not easy. -
If you want to show the structure of a particular subfolder, configure the view accordingly. There's an example of that in QFileSystemModel's details.
-
If you want to show the structure of a particular subfolder, configure the view accordingly. There's an example of that in QFileSystemModel's details.
@SGaist
Oh, I'm sorry that I didn't explain enough.
I already know about that part. But what I wanted to do was put an additional path into the QFilesystemmodel, like a Windows virtual folder, so that non-drive folders could be printed out. But the more I looked, the more I found it difficult and only one model could be set.
That's why I'm wandering... -
Do you already have the logic in place for that virtual folder ? If not, start by implementing it. Then you can consider using a proxy model to put them together.
-
Do you already have the logic in place for that virtual folder ? If not, start by implementing it. Then you can consider using a proxy model to put them together.
@SGaist
It hasn't been implemented yet, so I'd like to use QStandardItemmodel to create a custom model, and for drive output available on my computer, I'd like to see how to use Windows 32api or read it through the registry.When I asked other people, they said yes, but I don't know if it's true because I've never done it before.