From 5f552e7b964219772482fafaaff380a36a6d8927 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 15 Jun 2020 09:00:17 +0200 Subject: [PATCH] Allow constructing a null variant from a meta type Add a default argument for the data pointer, so one can construct a null variant of a certain metatype. This is meant to help replace the QVariant(Type) constructor that will get deprecated. Change-Id: If75a1491ffcaa82d28eb5a7efb547da0ef1f2a87 Reviewed-by: Fabian Kosmale Reviewed-by: Thiago Macieira --- src/corelib/kernel/qvariant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index 4690ce1d071..e64c118b9df 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -209,7 +209,7 @@ class Q_CORE_EXPORT QVariant ~QVariant(); QVariant(Type type); QVariant(int typeId, const void *copy, uint flags = 0); // ### Qt6 TODO deprecate - explicit QVariant(QMetaType type, const void *copy); + explicit QVariant(QMetaType type, const void *copy = nullptr); QVariant(const QVariant &other); #ifndef QT_NO_DATASTREAM