diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-06-15 09:00:17 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-08-14 23:41:42 +0200 |
commit | 5f552e7b964219772482fafaaff380a36a6d8927 (patch) | |
tree | 49637a74ced326d3f51c7a4510782f0c8b314dc6 | |
parent | ad80d57635e43b76681646251ee580e8a7774df1 (diff) |
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 <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/kernel/qvariant.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index 4690ce1d07..e64c118b9d 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 |