Skip to content
  • 0 Votes
    4 Posts
    657 Views
    S
    I was able to fix this with the following: https://github.com/qt/qtbase/commit/7d92ef63d7c And the following patch in Qt-5.15.2 which tremendously improved the timing: [image: 33f58cff-aeb8-48d6-ac64-d8120b77d822.png]
  • 0 Votes
    3 Posts
    519 Views
    S0ulM1keS
    @GrecKo the problem is, that GridView releases it delegates when model's elements is removed. It provokes Image to reload if delegate is shown again. No meter if I set cache: true Such a shame that GridView don't have reuseItems like ListView I've come with next decision. I've created Repeater containing Image that use source model. GridView's delegate Image use Repeater's function itemAt() giving delegate's index after mapping to source model: //Image in deleagte Image { Component.onCompleted: { source = appModelImages.loadImage(appFilterModel.mapRowToSource(parent.delegateIndex)) // custom implementation } ... } //Repeater Repeater { id: appModelImages visible: false function loadImage(index){ return itemAt(index).source } model: AppModel delegate: Image { visible: false asynchronous: true source: model.boxart } } This may be not the best decision, but "faster" than create own delegate pool for GridView. Didn't see any examples of implementing mechanism like this. Repeater should work fine, as it relays on source model. And as I expected, images live when source model does.
  • 0 Votes
    25 Posts
    9k Views
    B
    @jeremy_k Wow, Awesome ! Thanks for your answer and massive props to @VRonin !
  • 0 Votes
    9 Posts
    10k Views
    VRoninV
    @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
  • 0 Votes
    4 Posts
    3k Views
    SGaistS
    Adapted from the documentation example: model->setFilter("should_alarm=1");
  • 0 Votes
    2 Posts
    2k Views
    C
    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)