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

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

    XMLWordPrintable

Details

    • All
    • 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

          For Gerrit Dashboard: QTBUG-92260
          # Subject Branch Project Status CR V

          Activity

            People

              sgaist Samuel Gaist
              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