Navigation

    Qt Forum

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

    • UNSOLVED QFileSystemModel and QSortFilterProxyModel - root index is not preserved
      General and Desktop • c++ qsortfilterprox qfilesystemmode filtering • • MasterBLB  

      22
      0
      Votes
      22
      Posts
      1853
      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.
    • SOLVED change QSortFilterProxyModel behaviour for multiple column filtering
      General and Desktop • qtableview model-view qsortfilterprox qstandarditemmo filtering • • IMAN4K  

      9
      0
      Votes
      9
      Posts
      7001
      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 Update QSqlTableModel after QSqlQuery executing
      General and Desktop • qsqltablemodel qsqldatabase qsqlquery filtering • • EskeHagen  

      4
      0
      Votes
      4
      Posts
      2477
      Views

      Adapted from the documentation example: model->setFilter("should_alarm=1");
    • QSortFilterProxyModel filter by multiple coloumns
      General and Desktop • qsortfilterprox filtering • • beetle  

      2
      0
      Votes
      2
      Posts
      1262
      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)