diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-12-29 16:37:38 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-12-29 16:37:38 +0100 |
commit | aaff94c2df665035addb90714bab4722003894da (patch) | |
tree | 3af76e8aa4dbf86a86b1e4d2ad2f6dda06374ee0 /examples | |
parent | 2302d386c7a1aa1a96658f79c236d6b8a59db7ac (diff) | |
parent | 1196f691120d77ab3be55f21824aba645210fb8c (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
src/corelib/tools/qbytearray.cpp
src/gui/kernel/qplatformsystemtrayicon.cpp
src/gui/kernel/qplatformsystemtrayicon.h
src/plugins/platforms/xcb/xcb-plugin.pro
Change-Id: I00355d3908b678af8a61c38f9e814a63df808c79
Diffstat (limited to 'examples')
-rw-r--r-- | examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp b/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp index af4d8b477b..70af51cd1e 100644 --- a/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp +++ b/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp @@ -91,15 +91,15 @@ bool MySortFilterProxyModel::lessThan(const QModelIndex &left, if (leftData.type() == QVariant::DateTime) { return leftData.toDateTime() < rightData.toDateTime(); } else { - QRegExp *emailPattern = new QRegExp("([\\w\\.]*@[\\w\\.]*)"); + static QRegExp emailPattern("[\\w\\.]*@[\\w\\.]*)"); QString leftString = leftData.toString(); - if(left.column() == 1 && emailPattern->indexIn(leftString) != -1) - leftString = emailPattern->cap(1); + if(left.column() == 1 && emailPattern.indexIn(leftString) != -1) + leftString = emailPattern.cap(1); QString rightString = rightData.toString(); - if(right.column() == 1 && emailPattern->indexIn(rightString) != -1) - rightString = emailPattern->cap(1); + if(right.column() == 1 && emailPattern.indexIn(rightString) != -1) + rightString = emailPattern.cap(1); return QString::localeAwareCompare(leftString, rightString) < 0; } |