summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2013-11-17 16:13:08 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-11 10:04:48 +0100
commit4031cb8610dd311910d550201230ea8ab0f6a89a (patch)
treeb73848d7559c96ee5efcb54ec32392958a15ae28 /src/corelib/kernel/qobject.cpp
parent5e519b31dceff1fbb0a7ac5eeb5f6e071c1b6ef7 (diff)
Move-enable QSignalBlocker
When QSignalBlocker was reviewed, move semantics were asked for. This patch add them. This makes QSignalBlocker usable as a by-value argument (to transfer control of signal blocking into a function) as well as as a return value (to transfer control of signal blocking out of a function). Change-Id: I714aa2a283bb33dba76e860649e88ed202e913c5 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
-rw-r--r--src/corelib/kernel/qobject.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 50d4583dea..5880b96f32 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -530,6 +530,27 @@ void QMetaCallEvent::placeMetaCall(QObject *object)
*/
/*!
+ \fn QSignalBlocker::QSignalBlocker(QSignalBlocker &&other)
+
+ Move-constructs a signal blocker from \a other. \a other will have
+ a no-op destructor, while repsonsibility for restoring the
+ QObject::signalsBlocked() state is transferred to the new object.
+*/
+
+/*!
+ \fn QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other)
+
+ Move-assigns this signal blocker from \a other. \a other will have
+ a no-op destructor, while repsonsibility for restoring the
+ QObject::signalsBlocked() state is transferred to this object.
+
+ The object's signals this signal blocker was blocking prior to
+ being moved to, if any, are unblocked \em except in the case where
+ both instances block the same object's signals and \c *this is
+ unblocked while \a other is not, at the time of the move.
+*/
+
+/*!
\fn QSignalBlocker::~QSignalBlocker()
Destructor. Restores the QObject::signalsBlocked() state to what it