diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-09-11 15:24:17 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-09-17 13:26:50 +0200 |
commit | 861c4d854879b4e0358ad2f02d22753c37d57006 (patch) | |
tree | ef7584d00ca853682656de1b496af963430fb3f0 /src/gui/kernel | |
parent | e8b1e7e3192c258c21f01b85d52b698fe43c73e0 (diff) |
Deprecate implicit QPixmap conversion to QBitmap
It is lossy, so should be requested explicitly, using a dedicated
fromPixmap factory function.
Deprecate the constructor and assignment operator, and make the
constructor explicit.
[ChangeLog][QtGui][QBitmap] Implicitly constructing and assigning
to a QBitmap from a QPixmap has been deprecated, and the respective
constructor has been made explicit. Use the fromPixmap factory
function instead.
Change-Id: I68ce85b26c901415137b664a1db687021d48bae0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qguivariant.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qshapedpixmapdndwindow.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index 1af0692173..d7e88025b9 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -155,7 +155,7 @@ static const struct : QMetaTypeModuleHelper QMETATYPE_CONVERTER(QPixmap, QImage, result = QPixmap::fromImage(source); return true;); QMETATYPE_CONVERTER(QImage, QPixmap, result = source.toImage(); return true;); QMETATYPE_CONVERTER(QPixmap, QBitmap, result = source; return true;); - QMETATYPE_CONVERTER(QBitmap, QPixmap, result = source; return true;); + QMETATYPE_CONVERTER(QBitmap, QPixmap, result = QBitmap::fromPixmap(source); return true;); QMETATYPE_CONVERTER(QImage, QBitmap, result = source.toImage(); return true;); QMETATYPE_CONVERTER(QBitmap, QImage, result = QBitmap::fromImage(source); return true;); QMETATYPE_CONVERTER(QPixmap, QBrush, result = source.texture(); return true;); diff --git a/src/gui/kernel/qshapedpixmapdndwindow.cpp b/src/gui/kernel/qshapedpixmapdndwindow.cpp index 1a85a5e853..e58d37693a 100644 --- a/src/gui/kernel/qshapedpixmapdndwindow.cpp +++ b/src/gui/kernel/qshapedpixmapdndwindow.cpp @@ -76,7 +76,7 @@ void QShapedPixmapWindow::setPixmap(const QPixmap &pixmap) const auto pixmapDpr = m_pixmap.devicePixelRatio(); const auto winDpr = devicePixelRatio(); const auto maskSize = (QSizeF(m_pixmap.size()) * winDpr / pixmapDpr).toSize(); - platformWindow->setMask(QBitmap(mask.scaled(maskSize))); + platformWindow->setMask(QBitmap::fromPixmap(mask.scaled(maskSize))); } } } |