path: root/src
diff options
authorMarc Mutz <>2012-02-28 22:27:48 +0100
committerQt by Nokia <>2012-02-29 13:52:01 +0100
commit8b33be0054517e7506f1ed4378232fa81e710df1 (patch)
treef9b5c6a6922be8e25a99d63f0cf36a58d3d2e623 /src
parentec234625c0bde3eeb67cd4681cb66277bdf115b3 (diff)
QScopedValueRollback: make constructor explicit
I'm not even sure whether you could implicitly convert a T& into a QScopedValueRollback<T>, seeing as the constructor takes a non-const reference, but it looks wrong without explicit and QObject o = new QObject(parent); also won't compile even with implicit QObject(QObject*) under a conformant compiler because of the disabled copy constructor, and we still make QObject(QObject*) explicit, so add it here, too. Change-Id: I722a6e8431644e450fe2b401ccfb707a8e982380 Reviewed-by: Olivier Goffart <> Reviewed-by: Lars Knoll <> Reviewed-by: Shane Kearns <>
Diffstat (limited to 'src')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qscopedvaluerollback.h b/src/corelib/tools/qscopedvaluerollback.h
index 23d2d9eda0..d53cabd315 100644
--- a/src/corelib/tools/qscopedvaluerollback.h
+++ b/src/corelib/tools/qscopedvaluerollback.h
@@ -51,7 +51,7 @@ template <typename T>
class QScopedValueRollback
- QScopedValueRollback(T &var) :
+ explicit QScopedValueRollback(T &var) :
oldValue = varRef;