-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mon / Qt Apps] Fixed filter-function #1591
Conversation
The MultiColumnSortFilterProxyModel now supports QRegexp and QRegularExpression depending on the Qt Version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
if (!filter_regexp.isEmpty()) | ||
{ | ||
// Use QRegExp | ||
for (int column : filter_columns_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: replace loop by 'std::any_of()' [readability-use-anyofallof]
for (int column : filter_columns_)
^
if (!filter_regexp.isEmpty()) | ||
{ | ||
// Use QRegExp | ||
for (int column : filter_columns_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'column' of type 'int' can be declared 'const' [misc-const-correctness]
for (int column : filter_columns_) | |
for (int const column : filter_columns_) |
// Use QRegExp | ||
for (int column : filter_columns_) | ||
{ | ||
QModelIndex index = sourceModel()->index(source_row, column, source_parent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'index' of type 'QModelIndex' can be declared 'const' [misc-const-correctness]
QModelIndex index = sourceModel()->index(source_row, column, source_parent); | |
QModelIndex const index = sourceModel()->index(source_row, column, source_parent); |
QModelIndex index = sourceModel()->index(source_row, column, source_parent); | ||
if (index.isValid()) | ||
{ | ||
QString data = sourceModel()->data(index, filterRole()).toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'data' of type 'QString' can be declared 'const' [misc-const-correctness]
QString data = sourceModel()->data(index, filterRole()).toString(); | |
QString const data = sourceModel()->data(index, filterRole()).toString(); |
// Use QRegularExpression, as QRegExp is empty | ||
QRegularExpression const filter_regularexpression = filterRegularExpression(); | ||
|
||
for (int column : filter_columns_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: replace loop by 'std::any_of()' [readability-use-anyofallof]
for (int column : filter_columns_)
^
// Use QRegularExpression, as QRegExp is empty | ||
QRegularExpression const filter_regularexpression = filterRegularExpression(); | ||
|
||
for (int column : filter_columns_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'column' of type 'int' can be declared 'const' [misc-const-correctness]
for (int column : filter_columns_) | |
for (int const column : filter_columns_) |
|
||
for (int column : filter_columns_) | ||
{ | ||
QModelIndex index = sourceModel()->index(source_row, column, source_parent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'index' of type 'QModelIndex' can be declared 'const' [misc-const-correctness]
QModelIndex index = sourceModel()->index(source_row, column, source_parent); | |
QModelIndex const index = sourceModel()->index(source_row, column, source_parent); |
QModelIndex index = sourceModel()->index(source_row, column, source_parent); | ||
if (index.isValid()) | ||
{ | ||
QString data = sourceModel()->data(index, filterRole()).toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'data' of type 'QString' can be declared 'const' [misc-const-correctness]
QString data = sourceModel()->data(index, filterRole()).toString(); | |
QString const data = sourceModel()->data(index, filterRole()).toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
if (!filter_regexp.isEmpty()) | ||
{ | ||
// Use QRegExp | ||
for (const int column : filter_columns_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: replace loop by 'std::any_of()' [readability-use-anyofallof]
for (const int column : filter_columns_)
^
// Use QRegularExpression, as QRegExp is empty | ||
QRegularExpression const filter_regularexpression = filterRegularExpression(); | ||
|
||
for (const int column : filter_columns_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: replace loop by 'std::any_of()' [readability-use-anyofallof]
for (const int column : filter_columns_)
^
Tested with Qt 5.9 / 5.15 / 6.6.1 |
The MultiColumnSortFilterProxyModel now supports QRegexp and QRegularExpression depending on the Qt Version
The MultiColumnSortFilterProxyModel now supports QRegexp and QRegularExpression depending on the Qt Version
Description
The MultiColumnSortFilterProxyModel now supports QRegexp and QRegularExpression depending on the Qt Version
Related issues