Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Solved filter and unfilter QSortFilterProxyModel

    General and Desktop
    2
    3
    696
    Loading More Posts
    • 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
      samdol last edited by

      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 Reply Quote 0
      • V
        VRonin last edited by

        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 Reply Quote 2
        • S
          samdol @VRonin last edited by

          @VRonin

          Thanks, It works as expected.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post