Nope.
Qt Code:
{ return mFiles.size(); }To copy to clipboard, switch view to plain text mode
Nope.
Qt Code:
{ return mFiles.size(); }To copy to clipboard, switch view to plain text mode
Add this
Qt Code:
{ if(parent.isValid()) return 0; return mFiles.size(); }To copy to clipboard, switch view to plain text mode
also do the corresponding changes in parent() and index()
When you know how to do it then you may do it wrong.
When you don't know how to do it then it is not that you may do it wrong but you may not do it right.
Being new to Qt in general, I'm a bit lost... The parent() and index() functions have not been implemented in the source model. I presume that's something that needs to be done? Any examples you could point to that might fill in the gaps in my understanding on this?
I may not have a clear enough understanding of Qt, but could it be that the proxied view gets messed up because the item is being manipulated w.r.t the source model parent index and not the proxy model? That is, I presume each proxy has a local parent for it's filtered version of the source model (since it will have it's own unique index values)... So, if the drag/drop and related operations reference the items according to the source model's parent, then it would make sense that they would get screwed up when rendered in a view that is filtered by a proxy...
Which would suggest implementing the source model methods that take a parent() parameter in the proxy and calling the source model method with mapToSource() ... ?
What is you model based on QAbstractItemModel/QAbstractTableModel/QStandardItemModel?
When you know how to do it then you may do it wrong.
When you don't know how to do it then it is not that you may do it wrong but you may not do it right.
source inherits QAbstractTableModel, proxies inherhit QSortFilterProxyModel...
Ok, Can you post a minimal working code which illustrates the problem?
When you know how to do it then you may do it wrong.
When you don't know how to do it then it is not that you may do it wrong but you may not do it right.
Bookmarks