From f51c9010772e86d92740ed73ebae00567d980715 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 5 Apr 2019 09:26:21 +0200 Subject: Fix deprecation warnings about QVariant API Fix warnings like: video/qvideosurfaceformat.cpp:522:47: warning: 'QVariant qVariantFromValue(const T&) [with T = QAbstractVideoBuffer::HandleType]' is deprecated: Use QVariant::fromValue() instead. [-Wdeprecated-declarations] video/qvideosurfaceformat.cpp:524:48: warning: 'QVariant qVariantFromValue(const T&) [with T = QVideoFrame::PixelFormat]' is deprecated: Use QVariant::fromValue() instead. [-Wdeprecated-declarations] video/qvideosurfaceformat.cpp:534:54: warning: 'QVariant qVariantFromValue(const T&) [with T = QVideoSurfaceFormat::Direction]' is deprecated: Use QVariant::fromValue() instead. [-Wdeprecated-declarations] video/qvideosurfaceformat.cpp:536:46: warning: 'QVariant qVariantFromValue(const T&) [with T = double]' is deprecated: Use QVariant::fromValue() instead. [-Wdeprecated-declarations] video/qvideosurfaceformat.cpp:538:53: warning: 'QVariant qVariantFromValue(const T&) [with T = QSize]' is deprecated: Use QVariant::fromValue() instead. [-Wdeprecated-declarations] video/qvideosurfaceformat.cpp:542:52: warning: 'QVariant qVariantFromValue(const T&) [with T = QVideoSurfaceFormat::YCbCrColorSpace]' is deprecated: Use QVariant::fromValue() instead. [-Wdeprecated-declarations] Task-number: QTBUG-74043 Change-Id: I95f3bba4e63d83d02183a76be41d3819e0f400d8 Reviewed-by: VaL Doroshchuk --- tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp | 4 ++-- tests/auto/unit/qvideosurfaceformat/tst_qvideosurfaceformat.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/auto/unit') diff --git a/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp b/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp index 94d297ad0..871ff3cc7 100644 --- a/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp +++ b/tests/auto/unit/qmediaplayer/tst_qmediaplayer.cpp @@ -1329,7 +1329,7 @@ void tst_QMediaPlayer::testAudioRole() spy.clear(); - player.setProperty("audioRole", qVariantFromValue(QAudio::AlarmRole)); + player.setProperty("audioRole", QVariant::fromValue(QAudio::AlarmRole)); QCOMPARE(qvariant_cast(player.property("audioRole")), QAudio::AlarmRole); QCOMPARE(mockService->mockAudioRoleControl->audioRole(), QAudio::AlarmRole); QCOMPARE(spy.count(), 1); @@ -1397,7 +1397,7 @@ void tst_QMediaPlayer::testCustomAudioRole() spyCustomRole.clear(); QString customRole2(QStringLiteral("customRole2")); - player.setProperty("customAudioRole", qVariantFromValue(customRole2)); + player.setProperty("customAudioRole", QVariant::fromValue(customRole2)); QCOMPARE(qvariant_cast(player.property("customAudioRole")), customRole2); QCOMPARE(mockService->mockCustomAudioRoleControl->customAudioRole(), customRole2); QCOMPARE(spyRole.count(), 0); diff --git a/tests/auto/unit/qvideosurfaceformat/tst_qvideosurfaceformat.cpp b/tests/auto/unit/qvideosurfaceformat/tst_qvideosurfaceformat.cpp index 5412a838d..4fa754a45 100644 --- a/tests/auto/unit/qvideosurfaceformat/tst_qvideosurfaceformat.cpp +++ b/tests/auto/unit/qvideosurfaceformat/tst_qvideosurfaceformat.cpp @@ -321,7 +321,7 @@ void tst_QVideoSurfaceFormat::scanLineDirection() { QVideoSurfaceFormat format(QSize(16, 16), QVideoFrame::Format_RGB32); - format.setProperty("scanLineDirection", qVariantFromValue(direction)); + format.setProperty("scanLineDirection", QVariant::fromValue(direction)); QCOMPARE(format.scanLineDirection(), direction); QCOMPARE( @@ -363,7 +363,7 @@ void tst_QVideoSurfaceFormat::yCbCrColorSpaceEnum() } { QVideoSurfaceFormat format(QSize(64, 64), QVideoFrame::Format_RGB32); - format.setProperty("yCbCrColorSpace", qVariantFromValue(colorspace)); + format.setProperty("yCbCrColorSpace", QVariant::fromValue(colorspace)); QCOMPARE(format.yCbCrColorSpace(), colorspace); QCOMPARE(qvariant_cast(format.property("yCbCrColorSpace")), -- cgit v1.2.3