summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <[email protected]>2025-06-28 13:12:25 +0200
committerGiuseppe D'Angelo <[email protected]>2025-07-01 13:23:24 +0200
commitad080afa7fb00b0672e51e8315596d4540107d64 (patch)
treea2ec672a584b5688192b03d80287798d70695633 /src
parentfbb07fbfa49c810af2448c715d76bfe5eb45e4c8 (diff)
QVariant: remove a false statement about C++ unions
Since C++11 unions can store types with non-trivial special member functions. Remove the inaccurate paragraph from the documentation. Pick-to: 6.10 6.9 6.8 Change-Id: I2d2fa7e69da5e30f29e19b39a67a5fc28c250acd Reviewed-by: Thiago Macieira <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qvariant.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 3a2dcb4a12d..e91797a3ffe 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -321,11 +321,6 @@ static QVariant::Private clonePrivate(const QVariant::Private &other)
\compares equality
- Because C++ forbids unions from including types that have
- non-default constructors or destructors, most interesting Qt
- classes cannot be used in unions. Without QVariant, this would be
- a problem for QObject::property() and for database work, etc.
-
A QVariant object holds a single value of a single typeId() at a
time. (Some types are multi-valued, for example a string list.)
You can find out what type, T, the variant holds, convert it to a