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

QSortFilterProxyModel::setFilterRegularExpression(const QString &) preserves all pattern options

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 6.0.3, 6.1.0 Beta2
    • Fix Version/s: 6.0.4, 6.1.1, 6.2.0 Alpha
    • Component/s: Core: Item Models
    • Labels:
      None
    • Platform/s:
      All
    • Commits:
      bcbbbdb2d640c059c19e9337c7418b83b1b7e4ea (qt/qtbase/dev) dc9b55d6b232868a86471a6c0fcc17a82b0c7609 (qt/qtbase/6.0) f4292c10a3b0128a0bd41246a3084ffe814dd2c6 (qt/qtbase/6.1)

      Description

      The QRegularExpression rx variable inside the implementation of QSortFilterProxyModel::setFilterRegularExpression(const QString &) is unused. QRegularExpression::setPattern() leaves the pattern options unchanged. The intent of the current code seems to be: reset all pattern options except for QRegularExpression::CaseInsensitiveOption to defaults. This can be achieved by removing the unused variable rx and adding the following line:

      d->filter_data.setPatternOptions(d->filter_data.patternOptions() & QRegularExpression::CaseInsensitiveOption);
      

      Before Qt 5.15.2 this member function preserved none of the pattern options. With https://codereview.qt-project.org/c/qt/qtbase/+/310989 included in Qt 5.15.2, only QRegularExpression::CaseInsensitiveOption is preserved.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              sgaist Samuel Gaist
              Reporter:
              vedg Igor Kushnir
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes