diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2019-12-02 17:54:48 +0100 |
---|---|---|
committer | Olivier Goffart <ogoffart@woboq.com> | 2020-01-23 16:46:51 +0100 |
commit | 73d1476fb1397948a4d806bd921fce372bd8d63b (patch) | |
tree | a476349c26627027d78c1279da00ef633323311f /src/gui/image | |
parent | a78d66743171557d79b16c08be775e3ac15bb4ef (diff) |
Replace most use of QVariant::type and occurrences of QVariant::Type
I made a clazy automated check that replaced the use of QVariant::Type
by the equivalent in QMetaType.
This has been deprecated since Qt 5.0, but many uses were not yet removed.
In addition, there was some manual changes to fix the compilation errors.
Adapted the Private API of QDateTimeParser and QMimeDataPrivate
and adjust QDateTimeEdit and QSpinBox.
QVariant(QVariant::Invalid) in qstylesheet made no sense.
But note that in QVariant::save, we actually wanted to use the non-user type.
In the SQL module, many changes were actually reverted because the API
still expects QVarient::Type.
Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qbitmap.cpp | 2 | ||||
-rw-r--r-- | src/gui/image/qicon.cpp | 2 | ||||
-rw-r--r-- | src/gui/image/qimage.cpp | 2 | ||||
-rw-r--r-- | src/gui/image/qpixmap.cpp | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/image/qbitmap.cpp b/src/gui/image/qbitmap.cpp index 455045eb57..a44f7151b1 100644 --- a/src/gui/image/qbitmap.cpp +++ b/src/gui/image/qbitmap.cpp @@ -218,7 +218,7 @@ QBitmap::~QBitmap() */ QBitmap::operator QVariant() const { - return QVariant(QVariant::Bitmap, this); + return QVariant(QMetaType::QBitmap, this); } static QBitmap makeBitmap(QImage &&image, Qt::ImageConversionFlags flags) diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 19be066d23..38285dd827 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -782,7 +782,7 @@ QIcon &QIcon::operator=(const QIcon &other) */ QIcon::operator QVariant() const { - return QVariant(QVariant::Icon, this); + return QVariant(QMetaType::QIcon, this); } /*! \fn int QIcon::serialNumber() const diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 3ddc52bed4..62d2d0e948 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -1067,7 +1067,7 @@ int QImage::devType() const */ QImage::operator QVariant() const { - return QVariant(QVariant::Image, this); + return QVariant(QMetaType::QImage, this); } /*! diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 3fce64cb20..e914d7697f 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -402,7 +402,7 @@ QPixmap &QPixmap::operator=(const QPixmap &pixmap) */ QPixmap::operator QVariant() const { - return QVariant(QVariant::Pixmap, this); + return QVariant(QMetaType::QPixmap, this); } /*! |