Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. qsortfilterprox
    Log in to post

    • SOLVED Using QSortFilterProxyModel
      QML and Qt Quick • qml qsortfilterprox qt 5.9 • • BikashRDas  

      2
      0
      Votes
      2
      Posts
      64
      Views

      Hi, Are your properly calling the "signaling" methods in your custom model when you modify it ?
    • UNSOLVED Data not visible when loaded through QSortFilterProxyModel
      QML and Qt Quick • qsortfilterprox • • chilarai  

      2
      0
      Votes
      2
      Posts
      25
      Views

      Hi, Your proxy has a member variable that you set as source model. This looks wrong as already suggested in your other thread.
    • SOLVED Create multiple instances of QSortFilterProxyModel for view
      QML and Qt Quick • qsortfilterprox listview qml • • chilarai  

      5
      0
      Votes
      5
      Posts
      37
      Views

      That's correct. What you are trying to do with only one model is like having two pilots in one car trying to drive into two different directions at the same time.
    • SOLVED How to recent signal from proxyModel to model?
      General and Desktop • qtableview qsortfilterprox qabstracttablem • • zloi_templar  

      4
      0
      Votes
      4
      Posts
      44
      Views

      @VRonin yea, ty, already fix it
    • SOLVED QTreeView with QSortFilterProxyModel extremly slow with many (~5000) items
      General and Desktop • qtreeview qsortfilterprox slow • • gde23  

      4
      0
      Votes
      4
      Posts
      63
      Views

      @gde23 said in QTreeView with QSortFilterProxyModel extremly slow with many (~5000) items: Thanks for demanding a minimal example :) Thx for trying to create one - sadly a lot of people don't understand the demand for this but this here is a good example why it's needed :)
    • SOLVED filterAcceptsColumn work wrong in QSortFilterProxyModel
      General and Desktop • qt5 qsortfilterprox • • zloi_templar  

      6
      0
      Votes
      6
      Posts
      116
      Views

      @VRonin wow, it's really work. Thank you
    • SOLVED QSortFilterProxy & QIdentityProxyModel & QAbstractItemModel = Crash :- )
      General and Desktop • drag and drop qabstractitemmo qsortfilterprox drag&drop qidentityproxym • • Dariusz  

      26
      0
      Votes
      26
      Posts
      292
      Views

      @JKSH Yep I'm having a full run through the app now to ensure everything happens in GUI thread - that is widget/affects widget.
    • UNSOLVED QFileSystemModel and QSortFilterProxyModel - root index is not preserved
      General and Desktop • c++ qsortfilterprox qfilesystemmode filtering • • MasterBLB  

      22
      0
      Votes
      22
      Posts
      1107
      Views

      breaks SOLID It doesn't. In fact, if it worked as you expected it would break SOLID it's definitely a serious design flaw Sorry to be brutal: No, it's not a flaw, you just didn't understand the design of model/views. To help you get a better idea of what is going on, try use the same model with 2 different treeviews. In only one of the view call setRootIndex, and then trigger the filtering.
    • UNSOLVED QSortfilterproxymodel - simulate "new" root index?
      General and Desktop • qsortfilterprox • • Dariusz  

      4
      0
      Votes
      4
      Posts
      519
      Views

      So this needs a bump now, I tried using setRootIndex but that did not work... https://forum.qt.io/topic/102454/qtreeview-setrootindex-changing-header-incorrect-columncount/6 So I'm back to proxyModels... my main issue now is, how can I set a new rootIndex/item to that sortFilterProxy kick in from right infex and not from old index? As far as I can tell the filtering starts when tree request item, which usually is the root item, so header item. Since thats not the item I want to show I return false & since I return false there are no more items to query - thus no children thus the item that I actually want to show as new root never gets called/checked... if I use filterAcceptsRow() function... so where/who do I change to set different rootItem via proxy model?
    • SOLVED Notifying model QSortFilterProxyModel / QIdentityProxyModel of model data change?
      General and Desktop • qabstractitemmo qsortfilterprox qdrag drag drop qidentityproxym • • Dariusz  

      3
      0
      Votes
      3
      Posts
      540
      Views

      You may also try to set dynamicSortFilter: true, but only if you do not modify contents of model through proxy model. invalidate() calls are expensive and you should only do it when you know what you are doing. If you modify contents of your model through proxy model and/or you need to filter and sort on demand, invalidateFilter() and sort() is what you are looking for.
    • SOLVED Implement QSortFilterProxyModel with own TreeModel?
      General and Desktop • treeview qsortfilterprox sort treemodel • • Opa114  

      11
      0
      Votes
      11
      Posts
      909
      Views

      @VRonin said in Implement QSortFilterProxyModel with own TreeModel?: Good guess, can you show us your code? I solved it: I had to pass the parent index (tree structure), so the line should look like this: QVariant data = m_proxy->data(m_proxy->index(index.row(), 4, index.parent()));
    • SOLVED Reimplementing QFileSystemModel Checkboxes using QMap inconsistent results
      General and Desktop • qtreeview qabstractitemmo qsortfilterprox qfilesystemmode • • moffa13  

      15
      0
      Votes
      15
      Posts
      1156
      Views

      Ok I found what was causing this awful bug. When I check if the map contains the index, I actually check the raw index not the QPersistantModelIndex so this is not the same object and I think qmap does not check equality using == operator . So I have to iterate over the map and check using QPersistantModelIndex "==" operators which can compare from a QModelIndex.
    • SOLVED how to updating a view's proxy model when the source model changes.
      General and Desktop • qsortfilterprox qstandarditemmo qmodelindex • • Yash001  

      10
      0
      Votes
      10
      Posts
      3449
      Views

      @VRonin Thank you. Yesterday, I tried same things. But it was not working than later on I found, I forget to add file name in SOURCE , HEADER. Now it is work as expectation.
    • SOLVED How to add the check box with item, and Checkbox should check by the user.
      General and Desktop • qsortfilterprox qstandarditem qstandarditemmo qcheckbox qmodelidex • • Yash001  

      5
      0
      Votes
      5
      Posts
      1178
      Views

      Thank you @mrjj and @Christian for answer. I am able to make user Checkable. class CustomListModel : public QStandardItemModel { public: Qt::ItemFlags CustomListModel::flags(const QModelIndex & index) const { Qt::ItemFlags defaultFlags = QStandardItemModel::flags(index); if (index.isValid()) { return defaultFlags | Qt::ItemIsUserCheckable; } return defaultFlags; } CustomListModel(const int row, const int coloumn) : QStandardItemModel(row, coloumn) { } }; and modification. hwListProxyModel->setSourceModel(new CustomListModel (0, 0));
    • SOLVED change QSortFilterProxyModel behaviour for multiple column filtering
      General and Desktop • qtableview model-view qsortfilterprox qstandarditemmo filtering • • IMAN4K  

      9
      0
      Votes
      9
      Posts
      5495
      Views

      @IMAN4K said in change QSortFilterProxyModel behaviour for multiple column filtering: Answer from stackfverflow : http://stackoverflow.com/questions/39488901/change-qsortfilterproxymodel-behaviour-for-multiple-column-filtering This answer is the typical example that lead people to say subclassing QSortFilterProxyModel, which would likely have a very limited reusability It's bad. the proxy model implementation should not depend on the structure of the underlying data in sourceModel
    • UNSOLVED What class of Proxy Model should I pick in the case?
      General and Desktop • qsortfilterprox models sort filter mapping • • Kofr  

      4
      0
      Votes
      4
      Posts
      999
      Views

      @Kofr mapFromSource() and mapToSource() are enough. The default implementation should depend on these methods only.
    • SOLVED Absolute path of files and folders in QSortFilterProxyModel+QTreeview
      General and Desktop • qtreeview qt5.6 qsortfilterprox absolutepath • • Punit  

      2
      0
      Votes
      2
      Posts
      1583
      Views

      Problem Solved. CODE QModelIndex index2=proxymodel->mapToSource(index); //Returns the source model index (In my case it was QFileSystemModel) QString selectedrow=filemodel->fileInfo(index2).absoluteFilePath(); //filemodel is My QFileSystem Model.
    • UNSOLVED Add new row in QTreeView (Using QFileSystemModel to populate TreeView and QSortFilterProxy model to filter folder)
      General and Desktop • qtreeview qt5.6 qsortfilterprox qfilesystemmode row • • Punit  

      2
      0
      Votes
      2
      Posts
      1537
      Views

      Hi, Apply the same filter you are using for your single folder version except that this time rather than using a QString you should keep a QStringList of the folders you want to show and use that.
    • UNSOLVED CheckableProxyModel - saving/loading check states
      General and Desktop • qtreeview qsortfilterprox checkableproxym load checkstate • • Orkblutt  

      4
      0
      Votes
      4
      Posts
      1614
      Views

      One possibility might be to use directoryLoaded.
    • SOLVED QSortFilterProxyModel not requesting data...
      QML and Qt Quick • qt quick model qsortfilterprox • • David.G  

      5
      0
      Votes
      5
      Posts
      1693
      Views

      Good ! Since you have it working now, please mark the thread as solved using the "Topic Tool" button so that other forum users may know a solution has been found :)
    • base class QSortFilterProxyModel has private copy constructor
      General and Desktop • qsortfilterprox • • mrenoch  

      4
      0
      Votes
      4
      Posts
      1188
      Views

      You have to register your custom types
    • QSortFilterProxyModel filter by multiple coloumns
      General and Desktop • qsortfilterprox filtering • • beetle  

      2
      0
      Votes
      2
      Posts
      1188
      Views

      You could stack two QSortFilterProxyModels on top of the each other, one filtering on the first column/value, and the other on the second column/value. Alternatively, you could subclass QSortFilterProxyModel to override filterAcceptsRow() and compare two columns against two filter values (the first is the existing column and value, and a second you add)
    • QSortFilterProxyModel::invalidateFilter() doesn't result in call QSortFilterProxyModel::filterAcceptsRow(...)
      General and Desktop • qt5.5 qsortfilterprox filter • • mkolenda  

      1
      0
      Votes
      1
      Posts
      744
      Views

      No one has replied

    • filtering the filtered QSortFilterProxyModel
      General and Desktop • qsortfilterprox filters • • Stravinsky  

      1
      0
      Votes
      1
      Posts
      390
      Views

      No one has replied

    • setSortCaseSensitivity doesn't work
      General and Desktop • qsortfilterprox setsortcasesens qtcaseinsensiti • • cpuin  

      5
      0
      Votes
      5
      Posts
      1094
      Views

      @mcosta QSqlQueryModel
    • Subclass of QSortFilterProxyModel to filter selected columns
      General and Desktop • qsortfilterprox subclassing filters • • Stravinsky  

      15
      0
      Votes
      15
      Posts
      6583
      Views

      I don't understand your question 1. With a QList of hidden column, you don't need to know the size of the array in your model and you don't need to loop through the complete array to know which columns are hidden or not. You just need to do something like if (!hiddenColumnList.contains(index.column())) { // do some stuff if column is not hidden }
    • ListView with QAbstractListModel and QSortFilterProxyModel crashing on emitting dataChanged
      QML and Qt Quick • c++ qsortfilterprox qabstractlistmo • • JDGXNV  

      2
      0
      Votes
      2
      Posts
      1494
      Views

      @JDGXNV The delegates are recycled every-time you scroll which means there are created and destroyed as and when required internally (More here: delegate). Caching them disables it. So I guess the problem should be on the delegate side i.e the delegate is trying to access some property which it is not able and hence crashes.
    • QTreeView i Qsortfilterproxymodel
      Polish • qtreeview qsortfilterprox • • savior  

      1
      0
      Votes
      1
      Posts
      532
      Views

      No one has replied

    • [Solved] Sorting QML Tableview is slow
      QML and Qt Quick • qml qtableview qsortfilterprox • • eagain  

      8
      0
      Votes
      8
      Posts
      3586
      Views

      @eagain said: @p3c0 I tried, but apparently im too blind to find that button. The "Topic Tools" only contain the option to "Delete Topic" At the moment, only moderators can mark topics as solved: http://forum.qt.io/topic/51926/real-quick-forum-things/4 Tero, our community manager, is looking to give every user that ability. In the meantime, I believe you can mark it by editing the original post and adding "[Solved]" to the start of the title.