diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-04-23 17:46:55 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-24 09:35:22 +0200 |
commit | c9542b0538e0ceadba244b6208099b5513951976 (patch) | |
tree | f3517ca54de9df3d1d27cac7ab1d9d3314dc1b57 /src/designer/src/lib/shared/qdesigner_widgetbox.cpp | |
parent | 52de1b9b3ff7508ca7db70d677e4afe8835c5577 (diff) | |
download | qttools-c9542b0538e0ceadba244b6208099b5513951976.tar.gz |
Don't use the QRegExp methods that modify the object [Designer]
QRegExp matching methods modify the object, which we don't want to. In
particular, when we receive a QRegExp from the user or we store in a
context that might require thread-safety, make sure we make a copy
before using it.
QRegularExpression has no such shortcoming.
Task-number: QTBUG-25064
Change-Id: I58984ddce6a44cca7fe5a7b36e4595bad791d976
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/designer/src/lib/shared/qdesigner_widgetbox.cpp')
-rw-r--r-- | src/designer/src/lib/shared/qdesigner_widgetbox.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/designer/src/lib/shared/qdesigner_widgetbox.cpp b/src/designer/src/lib/shared/qdesigner_widgetbox.cpp index 0b868f407..31a49f5fb 100644 --- a/src/designer/src/lib/shared/qdesigner_widgetbox.cpp +++ b/src/designer/src/lib/shared/qdesigner_widgetbox.cpp @@ -170,7 +170,7 @@ bool QDesignerWidgetBox::findWidget(const QDesignerWidgetBoxInterface *wbox, QString pattern = QStringLiteral("^<widget\\s+class\\s*=\\s*\""); pattern += className; pattern += QStringLiteral("\".*$"); - const QRegExp regexp(pattern); + QRegExp regexp(pattern); Q_ASSERT(regexp.isValid()); const int catCount = wbox->categoryCount(); for (int c = 0; c < catCount; c++) { |