diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2012-08-21 10:05:41 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-07 18:41:22 +0200 |
commit | 939338c273539b51e622e61e5f375571eff3619e (patch) | |
tree | d20be94d96862298f1138d091ed607ef671cdebc /src/corelib | |
parent | 1f8d570d5fab14b299d272540ee9bbf692f98829 (diff) |
QVariant: prevent QVariant(QMetaType::Type) from compiling
Reported-by: Stephen Chu <stephen@ju-ju.com>
Change-Id: I298973174ff10f4462f04f3358c974c04dfd3383
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Stephen Chu <stephen@ju-ju.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/qvariant.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index bde67ed5ac..07043b1977 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -454,6 +454,13 @@ public: private: // force compile error, prevent QVariant(bool) to be called inline QVariant(void *) Q_DECL_EQ_DELETE; + // QVariant::Type is marked as \obsolete, but we don't want to + // provide a constructor from its intended replacement, + // QMetaType::Type, instead, because the idea behind these + // constructors is flawed in the first place. But we also don't + // want QVariant(QMetaType::String) to compile and falsely be an + // int variant, so delete this constructor: + QVariant(QMetaType::Type) Q_DECL_EQ_DELETE; #ifdef QT_NO_CAST_FROM_ASCII // force compile error when implicit conversion is not wanted inline QVariant(const char *) Q_DECL_EQ_DELETE; |