summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-09-10 17:05:10 +0200
committerLars Knoll <lars.knoll@qt.io>2020-10-23 09:58:57 +0200
commit11bad6109606794091adc3b8a14070ac09707f45 (patch)
tree603d07bada752a534a8549c6d008b9b8a4aa832a /src/sql
parenta618c260ed0d1de711a5bc20337f9b8c3835c407 (diff)
Deprecate QVariant::Type
It's been obsolete for a long time already. Make sure the compiler now warns about it and remove all remaining uses in qtbase. Change-Id: I0ff80311184dba52d2ba5f4e2fabe0d47fdc59d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/doc/snippets/code/src_sql_kernel_qsqlquery.cpp2
-rw-r--r--src/sql/kernel/qsqlfield.h14
-rw-r--r--src/sql/kernel/qsqlquery.cpp6
-rw-r--r--src/sql/kernel/qsqlresult.cpp2
4 files changed, 12 insertions, 12 deletions
diff --git a/src/sql/doc/snippets/code/src_sql_kernel_qsqlquery.cpp b/src/sql/doc/snippets/code/src_sql_kernel_qsqlquery.cpp
index 496c971621..71bd6eccf0 100644
--- a/src/sql/doc/snippets/code/src_sql_kernel_qsqlquery.cpp
+++ b/src/sql/doc/snippets/code/src_sql_kernel_qsqlquery.cpp
@@ -73,7 +73,7 @@ ints << 1 << 2 << 3 << 4;
q.addBindValue(ints);
QVariantList names;
-names << "Harald" << "Boris" << "Trond" << QVariant(QVariant::String);
+names << "Harald" << "Boris" << "Trond" << QVariant(QMetaType::QString);
q.addBindValue(names);
if (!q.execBatch())
diff --git a/src/sql/kernel/qsqlfield.h b/src/sql/kernel/qsqlfield.h
index 27ad47ca35..80b412a973 100644
--- a/src/sql/kernel/qsqlfield.h
+++ b/src/sql/kernel/qsqlfield.h
@@ -54,13 +54,6 @@ class Q_SQL_EXPORT QSqlField
public:
enum RequiredStatus { Unknown = -1, Optional = 0, Required = 1 };
-#if QT_DEPRECATED_SINCE(6, 0)
- QT_DEPRECATED_VERSION_X_6_0("Use the constructor using a QMetaType instead")
- QSqlField(const QString& fieldName, QVariant::Type type, const QString &tableName = QString())
- : QSqlField(fieldName, QMetaType(type), tableName)
- {}
-#endif
-
explicit QSqlField(const QString& fieldName = QString(), QMetaType type = QMetaType(), const QString &tableName = QString());
QSqlField(const QSqlField& other);
@@ -86,10 +79,17 @@ public:
void setMetaType(QMetaType type);
#if QT_DEPRECATED_SINCE(6, 0)
+ QT_WARNING_PUSH
+ QT_WARNING_DISABLE_DEPRECATED
+ QT_DEPRECATED_VERSION_X_6_0("Use the constructor using a QMetaType instead")
+ QSqlField(const QString& fieldName, QVariant::Type type, const QString &tableName = QString())
+ : QSqlField(fieldName, QMetaType(type), tableName)
+ {}
QT_DEPRECATED_VERSION_X_6_0("Use metaType() instead")
QVariant::Type type() const { return QVariant::Type(metaType().id()); };
QT_DEPRECATED_VERSION_X_6_0("Use setMetaType() instead")
void setType(QVariant::Type type) { setMetaType(QMetaType(int(type))); }
+ QT_WARNING_POP
#endif
void setRequiredStatus(RequiredStatus status);
diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp
index 5909709edc..d51d596d14 100644
--- a/src/sql/kernel/qsqlquery.cpp
+++ b/src/sql/kernel/qsqlquery.cpp
@@ -1047,7 +1047,7 @@ bool QSqlQuery::exec()
To bind NULL values, a null QVariant of the relevant type has to be
added to the bound QVariantList; for example, \c
- {QVariant(QVariant::String)} should be used if you are using
+ {QVariant(QMetaType::QString)} should be used if you are using
strings.
\note Every bound QVariantList must contain the same amount of
@@ -1085,7 +1085,7 @@ bool QSqlQuery::execBatch(BatchExecutionMode mode)
the result into.
To bind a NULL value, use a null QVariant; for example, use
- \c {QVariant(QVariant::String)} if you are binding a string.
+ \c {QVariant(QMetaType::QString)} if you are binding a string.
\sa addBindValue(), prepare(), exec(), boundValue(), boundValues()
*/
@@ -1115,7 +1115,7 @@ void QSqlQuery::bindValue(int pos, const QVariant& val, QSql::ParamType paramTyp
overwritten with data from the database after the exec() call.
To bind a NULL value, use a null QVariant; for example, use \c
- {QVariant(QVariant::String)} if you are binding a string.
+ {QVariant(QMetaType::QString)} if you are binding a string.
\sa bindValue(), prepare(), exec(), boundValue(), boundValues()
*/
diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp
index 5b440d704b..a948abb13e 100644
--- a/src/sql/kernel/qsqlresult.cpp
+++ b/src/sql/kernel/qsqlresult.cpp
@@ -935,7 +935,7 @@ void QSqlResult::virtual_hook(int, void *)
contain equal amount of values (rows).
NULL values are passed in as typed QVariants, for example
- \c {QVariant(QVariant::Int)} for an integer NULL value.
+ \c {QVariant(QMetaType::Int)} for an integer NULL value.
Example: