summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-03-15 14:27:00 +0100
committerLars Knoll <lars.knoll@qt.io>2020-04-01 10:29:26 +0200
commit70beac08afaec0ef0c4ef2e72ebfc007acba7d56 (patch)
treebdb53e3693e023ceae2658190b03162412bf66f8 /tests/auto/widgets/widgets
parent66f06a930da0114f62a5470e778182c50117ad27 (diff)
Remove all QRegExp dependencies from widgets
QRegExp is deprecated in Qt6 and will get moved to the Qt 5 compat library. As such we need to remove all API and usages of QRegExp in Qt. Change-Id: I33fb56701d3d7c577f98a304c1d4e6f626fcb397 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests/auto/widgets/widgets')
-rw-r--r--tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp44
-rw-r--r--tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp45
2 files changed, 0 insertions, 89 deletions
diff --git a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
index a86784f2ec..fa702f8661 100644
--- a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
+++ b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
@@ -135,11 +135,6 @@ private slots:
void insertAndScrollToBottom();
void inputMethodQueryImHints_data();
void inputMethodQueryImHints();
-#ifndef QT_NO_REGEXP
- void findWithRegExp();
- void findBackwardWithRegExp();
- void findWithRegExpReturnsFalseIfNoMoreResults();
-#endif
#if QT_CONFIG(regularexpression)
void findWithRegularExpression();
void findBackwardWithRegularExpression();
@@ -1562,45 +1557,6 @@ void tst_QPlainTextEdit::inputMethodQueryImHints()
QCOMPARE(static_cast<Qt::InputMethodHints>(value.toInt()), hints);
}
-#ifndef QT_NO_REGEXP
-void tst_QPlainTextEdit::findWithRegExp()
-{
- ed->setPlainText(QStringLiteral("arbitrary text"));
- QRegExp rx("\\w{2}xt");
-
- bool found = ed->find(rx);
-
- QVERIFY(found);
- QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text"));
-}
-
-void tst_QPlainTextEdit::findBackwardWithRegExp()
-{
- ed->setPlainText(QStringLiteral("arbitrary text"));
- QTextCursor cursor = ed->textCursor();
- cursor.movePosition(QTextCursor::End);
- ed->setTextCursor(cursor);
- QRegExp rx("a\\w*t");
-
- bool found = ed->find(rx, QTextDocument::FindBackward);
-
- QVERIFY(found);
- QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("arbit"));
-}
-
-void tst_QPlainTextEdit::findWithRegExpReturnsFalseIfNoMoreResults()
-{
- ed->setPlainText(QStringLiteral("arbitrary text"));
- QRegExp rx("t.xt");
- ed->find(rx);
-
- bool found = ed->find(rx);
-
- QVERIFY(!found);
- QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text"));
-}
-#endif
-
#if QT_CONFIG(regularexpression)
void tst_QPlainTextEdit::findWithRegularExpression()
{
diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
index bd287eb225..716e7da490 100644
--- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
@@ -194,12 +194,6 @@ private slots:
void countTextChangedOnRemove();
-#ifndef QT_NO_REGEXP
- void findWithRegExp();
- void findBackwardWithRegExp();
- void findWithRegExpReturnsFalseIfNoMoreResults();
-#endif
-
#if QT_CONFIG(regularexpression)
void findWithRegularExpression();
void findBackwardWithRegularExpression();
@@ -2609,45 +2603,6 @@ void tst_QTextEdit::countTextChangedOnRemove()
QCOMPARE(spy.count(), 1);
}
-#ifndef QT_NO_REGEXP
-void tst_QTextEdit::findWithRegExp()
-{
- ed->setHtml(QStringLiteral("arbitrary te<span style=\"color:#ff0000\">xt</span>"));
- QRegExp rx("\\w{2}xt");
-
- bool found = ed->find(rx);
-
- QVERIFY(found);
- QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text"));
-}
-
-void tst_QTextEdit::findBackwardWithRegExp()
-{
- ed->setPlainText(QStringLiteral("arbitrary text"));
- QTextCursor cursor = ed->textCursor();
- cursor.movePosition(QTextCursor::End);
- ed->setTextCursor(cursor);
- QRegExp rx("a\\w*t");
-
- bool found = ed->find(rx, QTextDocument::FindBackward);
-
- QVERIFY(found);
- QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("arbit"));
-}
-
-void tst_QTextEdit::findWithRegExpReturnsFalseIfNoMoreResults()
-{
- ed->setPlainText(QStringLiteral("arbitrary text"));
- QRegExp rx("t.xt");
- ed->find(rx);
-
- bool found = ed->find(rx);
-
- QVERIFY(!found);
- QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text"));
-}
-#endif
-
#if QT_CONFIG(regularexpression)
void tst_QTextEdit::findWithRegularExpression()
{