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 /tests/auto | |
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 'tests/auto')
-rw-r--r-- | tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp | 2 | ||||
-rw-r--r-- | tests/auto/gui/painting/qregion/tst_qregion.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp index c992b487bc..f262996980 100644 --- a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp @@ -1176,7 +1176,7 @@ static QCursor qCursorData(int index) case 3: return QCursor(Qt::BlankCursor); case 4: return QCursor(Qt::BlankCursor); case 5: return QCursor(QPixmap(open_xpm), 1, 1); - case 6: { QPixmap pm(open_xpm); return QCursor(QBitmap(pm), pm.mask(), 3, 4); } + case 6: { QPixmap pm(open_xpm); return QCursor(QBitmap::fromPixmap(pm), pm.mask(), 3, 4); } case 7: return QCursor(QPixmap(open_xpm), -1, 5); case 8: return QCursor(QPixmap(open_xpm), 5, -1); } diff --git a/tests/auto/gui/painting/qregion/tst_qregion.cpp b/tests/auto/gui/painting/qregion/tst_qregion.cpp index dc694e1107..27327d8d1a 100644 --- a/tests/auto/gui/painting/qregion/tst_qregion.cpp +++ b/tests/auto/gui/painting/qregion/tst_qregion.cpp @@ -382,7 +382,7 @@ void tst_QRegion::bitmapRegion() QVERIFY(region.isEmpty()); } { - circle = QPixmap(circle_xpm); + circle = QBitmap::fromPixmap(QPixmap(circle_xpm)); QRegion region(circle); //// These should not be inside the circe |