summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/text/qtextdocument.cpp2
-rw-r--r--src/gui/util/qvalidator.cpp5
-rw-r--r--tests/auto/other/lancelot/paintcommands.cpp2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index a8991d5428..f9fe166c29 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -1281,7 +1281,7 @@ QTextCursor QTextDocument::find(const QString &subString, const QTextCursor &fro
static bool findInBlock(const QTextBlock &block, const QRegExp &expression, int offset,
QTextDocument::FindFlags options, QTextCursor &cursor)
{
- const QRegExp expr(expression);
+ QRegExp expr(expression);
QString text = block.text();
text.replace(QChar::Nbsp, QLatin1Char(' '));
diff --git a/src/gui/util/qvalidator.cpp b/src/gui/util/qvalidator.cpp
index d0bd1cfc6d..3103cc7424 100644
--- a/src/gui/util/qvalidator.cpp
+++ b/src/gui/util/qvalidator.cpp
@@ -871,10 +871,11 @@ QRegExpValidator::~QRegExpValidator()
QValidator::State QRegExpValidator::validate(QString &input, int& pos) const
{
- if (r.exactMatch(input)) {
+ QRegExp copy = r;
+ if (copy.exactMatch(input)) {
return Acceptable;
} else {
- if (const_cast<QRegExp &>(r).matchedLength() == input.size()) {
+ if (copy.matchedLength() == input.size()) {
return Intermediate;
} else {
pos = input.size();
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp
index 969db62acb..4e45c75e4d 100644
--- a/tests/auto/other/lancelot/paintcommands.cpp
+++ b/tests/auto/other/lancelot/paintcommands.cpp
@@ -694,7 +694,7 @@ void PaintCommands::runCommand(const QString &scriptLine)
QString firstWord = scriptLine.section(QRegExp("\\s"), 0, 0);
QList<int> indices = s_commandHash.values(firstWord);
foreach(int idx, indices) {
- const PaintCommandInfos &command = s_commandInfoTable.at(idx);
+ PaintCommandInfos command = s_commandInfoTable.at(idx);
if (command.regExp.indexIn(scriptLine) >= 0) {
(this->*(command.paintMethod))(command.regExp);
return;