diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-06-15 09:31:31 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-08-15 10:56:33 +0200 |
commit | 67f04fa060be1b75b8ea60ac6eb45d1577d1fdaf (patch) | |
tree | 368d745ae016534cb2e18c7f5454fffbc8c1216f /examples/sql | |
parent | 8929c0a3550ae27cb5c9ed276d4c5a85594ba682 (diff) |
Deprecate QVariant::Type uses in QSqlField
Add metaType()/setMetaType() methods to be used instead
of the type() methods taking a QVariant::Type.
Change-Id: Ieaba35b73f8061cd83288dd6b50d58322db3c7ed
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'examples/sql')
-rw-r--r-- | examples/sql/masterdetail/dialog.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/sql/masterdetail/dialog.cpp b/examples/sql/masterdetail/dialog.cpp index 3267352b07..7777929dfd 100644 --- a/examples/sql/masterdetail/dialog.cpp +++ b/examples/sql/masterdetail/dialog.cpp @@ -117,9 +117,9 @@ int Dialog::addNewArtist(const QString &name) int id = generateArtistId(); - QSqlField f1("id", QVariant::Int); - QSqlField f2("artist", QVariant::String); - QSqlField f3("albumcount", QVariant::Int); + QSqlField f1("id", QMetaType(QMetaType::Int)); + QSqlField f2("artist", QMetaType(QMetaType::QString)); + QSqlField f3("albumcount", QMetaType(QMetaType::Int)); f1.setValue(QVariant(id)); f2.setValue(QVariant(name)); @@ -137,10 +137,10 @@ int Dialog::addNewAlbum(const QString &title, int artistId) int id = generateAlbumId(); QSqlRecord record; - QSqlField f1("albumid", QVariant::Int); - QSqlField f2("title", QVariant::String); - QSqlField f3("artistid", QVariant::Int); - QSqlField f4("year", QVariant::Int); + QSqlField f1("albumid", QMetaType(QMetaType::Int)); + QSqlField f2("title", QMetaType(QMetaType::QString)); + QSqlField f3("artistid", QMetaType(QMetaType::Int)); + QSqlField f4("year", QMetaType(QMetaType::Int)); f1.setValue(QVariant(id)); f2.setValue(QVariant(title)); |