Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-69612

Add example for QSortFilterProxyModel

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 5.11.1
    • Core: Item Models
    • None
    • Windows

    Description

      Under https://doc.qt.io/qt-5/qsortfilterproxymodel.html#filtering . the docs state:

      "A common use case is to let the user specify the filter regexp, wildcard pattern, or fixed string in a QLineEdit and to connect the textChanged()signal to setFilterRegExp(), setFilterWildcard(), or setFilterFixedString() to reapply the filter."

      Please put in snippets of how to do that. Something like:

      // Using function pointers (recommended):
      connect(myFilterLine, &QLineEdit::textChanged, proxyModel, &QSortFilterProxyModel::setFilterRegExp);
      
      // Using the older SIGNAL/SLOT approach (not recommended):
      connect(myFilterLine, SIGNAL(textChanged(const QString &)),&proxyModel, SLOT(setFilterRegExp(const QString &)));

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dfaure_kdab David Faure
            moshekaplan Moshe Kaplan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes