From ac2eb96b1983aa09f2d95a060b5dc31df228f33d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 27 Oct 2020 07:44:20 +0100 Subject: libpyside: Fix deprecation warnings about constructing a QVariant from a type id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Build the QVariant from the QMetaType, fixing warning like: libpyside/pysidemetafunction.cpp:186:64: warning: ‘Type’ is deprecated: Use QMetaType::Type instead. [-Wdeprecated-declarations] /libpyside/pysidemetafunction.cpp:186:77: warning: ‘QVariant::QVariant(QVariant::Type)’ is deprecated: Use the constructor taking a QMetaType instead. [-Wdeprecated-declarations] Change-Id: I5c9c4d775ef58ecf17326c112c5130c43fe1a09b Reviewed-by: Christian Tismer --- sources/pyside2/tests/pysidetest/testobject.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sources/pyside2/tests/pysidetest/testobject.h') diff --git a/sources/pyside2/tests/pysidetest/testobject.h b/sources/pyside2/tests/pysidetest/testobject.h index 41a97a0db..c31a2ab73 100644 --- a/sources/pyside2/tests/pysidetest/testobject.h +++ b/sources/pyside2/tests/pysidetest/testobject.h @@ -55,7 +55,7 @@ class PYSIDETEST_API TestObject : public QObject Q_OBJECT public: static void createApp() { int argc=0; new QApplication(argc, 0); }; - static int checkType(const QVariant& var) { return (int)var.type(); } + static int checkType(const QVariant& var) { return var.metaType().id(); } TestObject(int idValue, QObject* parent = 0) : QObject(parent), m_idValue(idValue) {} int idValue() const { return m_idValue; } -- cgit v1.2.3