summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-22 12:57:06 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-22 12:57:29 +0200
commitfe0475651556878b8b80b38058e5fa743822ddce (patch)
tree8181b063eed8a28486b758a3ff16eb6c166065fc
parent55c62fdd9cc1f9ec0fc18c6b4d804d9cb065dce0 (diff)
downloadqtxmlpatterns-fe0475651556878b8b80b38058e5fa743822ddce.tar.gz
Tests: Fix warnings about deprecated function qVariantFromValue()
Change-Id: I6351b21813f0680b21405fdeadd7ee072dae703f Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
-rw-r--r--tests/auto/qsourcelocation/tst_qsourcelocation.cpp2
-rw-r--r--tests/auto/qxmlitem/tst_qxmlitem.cpp2
-rw-r--r--tests/auto/qxmlname/tst_qxmlname.cpp7
-rw-r--r--tests/auto/qxmlquery/tst_qxmlquery.cpp6
4 files changed, 8 insertions, 9 deletions
diff --git a/tests/auto/qsourcelocation/tst_qsourcelocation.cpp b/tests/auto/qsourcelocation/tst_qsourcelocation.cpp
index b5b33c7..8d856be 100644
--- a/tests/auto/qsourcelocation/tst_qsourcelocation.cpp
+++ b/tests/auto/qsourcelocation/tst_qsourcelocation.cpp
@@ -330,7 +330,7 @@ void tst_QSourceLocation::setUri() const
void tst_QSourceLocation::withinQVariant() const
{
QSourceLocation val;
- const QVariant variant(qVariantFromValue(val));
+ const auto variant = QVariant::fromValue(val);
QSourceLocation val2(qvariant_cast<QSourceLocation>(variant));
}
diff --git a/tests/auto/qxmlitem/tst_qxmlitem.cpp b/tests/auto/qxmlitem/tst_qxmlitem.cpp
index b1e9f07..7beb93a 100644
--- a/tests/auto/qxmlitem/tst_qxmlitem.cpp
+++ b/tests/auto/qxmlitem/tst_qxmlitem.cpp
@@ -346,7 +346,7 @@ void tst_QXmlItem::constCorrectness() const
void tst_QXmlItem::withinQVariant() const
{
QXmlItem val;
- const QVariant variant(qVariantFromValue(val));
+ const auto variant = QVariant::fromValue(val);
QXmlItem val2(qvariant_cast<QXmlItem>(variant));
}
diff --git a/tests/auto/qxmlname/tst_qxmlname.cpp b/tests/auto/qxmlname/tst_qxmlname.cpp
index 7057137..9021af3 100644
--- a/tests/auto/qxmlname/tst_qxmlname.cpp
+++ b/tests/auto/qxmlname/tst_qxmlname.cpp
@@ -389,8 +389,7 @@ void tst_QXmlName::toClarkName_data() const
*/
void tst_QXmlName::withinQVariant() const
{
- /* The extra paranthesis silences a warning on win32-msvc2005. */
- QVariant value(qVariantFromValue(QXmlName()));
+ auto value = QVariant::fromValue(QXmlName());
}
/*!
@@ -398,9 +397,9 @@ void tst_QXmlName::withinQVariant() const
*/
void tst_QXmlName::typeWithinQVariant() const
{
- const int qxmlNameType = QVariant(qVariantFromValue(QXmlName())).userType();
+ const int qxmlNameType = QVariant::fromValue(QXmlName()).userType();
- const QVariant value(qVariantFromValue(QXmlName()));
+ const auto value = QVariant::fromValue(QXmlName());
QCOMPARE(value.userType(), qxmlNameType);
}
diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp
index df4b955..09d3816 100644
--- a/tests/auto/qxmlquery/tst_qxmlquery.cpp
+++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp
@@ -1215,9 +1215,9 @@ void tst_QXmlQuery::basicXQueryToQtTypeCheck() const
expectedValues.append(QVariant(QByteArray::fromHex(QByteArray("FFFF")))); /* xs:hexBinary("FFFF"), */
expectedValues.append(QVariant(QString::fromLatin1("http://example.com/"))); /* xs:anyURI("http://example.com/"), */
QXmlNamePool np(query.namePool());
- expectedValues.append(QVariant(qVariantFromValue(QXmlName(np, QLatin1String("localName"),
- QLatin1String("http://example.com/2"),
- QLatin1String("prefix")))));
+ expectedValues.append(QVariant::fromValue(QXmlName(np, QLatin1String("localName"),
+ QLatin1String("http://example.com/2"),
+ QLatin1String("prefix"))));
expectedValues.append(QVariant(QString::fromLatin1("An xs:string")));
expectedValues.append(QVariant(QString::fromLatin1("normalizedString")));