Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. filter and unfilter QSortFilterProxyModel
Qt 6.11 is out! See what's new in the release blog

filter and unfilter QSortFilterProxyModel

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    samdol
    wrote on last edited by
    #1

    Hi
    I could filter elements of QSortFilterProxyModel by
    proxyModel->setFilterRegExp(QRegExp("myword", Qt::CaseInsensitive, QRegExp::FixedString));
    proxyModel->setFilterKeyColumn(filterColumn);

    After that, how can I unfilter to go back to the state before filtering?
    In documnet, it says to use reset(). In Qt 4.8.x I could see reset(), but there is no such member function in Qt 5.5.0.

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      as stated in the docs just pass an empty string: proxyModel->setFilterRegExp(QString());

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      S 1 Reply Last reply
      2
      • VRoninV VRonin

        as stated in the docs just pass an empty string: proxyModel->setFilterRegExp(QString());

        S Offline
        S Offline
        samdol
        wrote on last edited by
        #3

        @VRonin

        Thanks, It works as expected.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved