From 73d1476fb1397948a4d806bd921fce372bd8d63b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 2 Dec 2019 17:54:48 +0100 Subject: 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 --- src/gui/image/qbitmap.cpp | 2 +- src/gui/image/qicon.cpp | 2 +- src/gui/image/qimage.cpp | 2 +- src/gui/image/qpixmap.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gui/image') 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); } /*! -- cgit v1.2.3 From ea4b837fa169c21afb79488b669d30bca2fcb94f Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 25 Jan 2020 20:15:19 +0100 Subject: Doc/QtGui: replace some 0 with \nullptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace some 'is 0' or 'are 0' where 0 referes to a nullptr with 'is \nullptr' and 'are \nullptr' Change-Id: Ic18d0c8bcf64159b4c8fae8c9499839954a98884 Reviewed-by: André Hartmann Reviewed-by: Sze Howe Koh --- src/gui/image/qimage.cpp | 4 ++-- src/gui/image/qpixmap.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gui/image') diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 62d2d0e948..23facb8517 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4058,7 +4058,7 @@ void QImage::setText(const QString &key, const QString &value) \obsolete Returns the text recorded for the given \a key in the given \a - language, or in a default language if \a language is 0. + language, or in a default language if \a language is \nullptr. Use text() instead. @@ -4085,7 +4085,7 @@ void QImage::setText(const QString &key, const QString &value) Sets the image text to the given \a text and associate it with the given \a key. The text is recorded in the specified \a language, - or in a default language if \a language is 0. + or in a default language if \a language is \nullptr. Use setText() instead. diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index e914d7697f..adadba2057 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -813,8 +813,8 @@ bool QPixmap::loadFromData(const uchar *buf, uint len, const char *format, Qt::I 0 to obtain small compressed files, 100 for large uncompressed files, and -1 to use the default settings. - If \a format is 0, an image format will be chosen from \a fileName's - suffix. + If \a format is \nullptr, an image format will be chosen from + \a fileName's suffix. \sa {QPixmap#Reading and Writing Image Files}{Reading and Writing Image Files} -- cgit v1.2.3 From 582311d1224cb196d8149bdfd8f178d5239c6b28 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Mon, 27 Jan 2020 17:11:51 +0800 Subject: Doc: Replace some usages of 0/zero/null with \nullptr Change-Id: Ibe7de11fc6fc41477c35e7d653c6a911855deabb Reviewed-by: Paul Wicking --- src/gui/image/qimage.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gui/image') diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 23facb8517..1166eb5023 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -3683,8 +3683,8 @@ QImage QImage::fromData(const uchar *data, int size, const char *format) /*! Saves the image to the file with the given \a fileName, using the given image file \a format and \a quality factor. If \a format is - 0, QImage will attempt to guess the format by looking at \a fileName's - suffix. + \nullptr, QImage will attempt to guess the format by looking at + \a fileName's suffix. The \a quality factor must be in the range 0 to 100 or -1. Specify 0 to obtain small compressed files, 100 for large uncompressed @@ -4099,7 +4099,7 @@ void QImage::setText(const QString &key, const QString &value) \l{http://www.libpng.org/pub/png/spec/1.2/png-1.2-pdg.html#C.Anc-text} {the PNG specification}. \a s can be any text. \a lang should specify the language code (see - \l{http://www.rfc-editor.org/rfc/rfc1766.txt}{RFC 1766}) or 0. + \l{http://www.rfc-editor.org/rfc/rfc1766.txt}{RFC 1766}) or \nullptr. \endomit */ -- cgit v1.2.3