summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpicture.h
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-04-19 19:12:21 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-09-03 10:57:10 (GMT)
commitda0e1a682362144b9f13b4c564f86e09efb681bb (patch)
tree8cbf68a93b055515b2a56d9e0667c530b27e39e2 /src/gui/image/qpicture.h
parent605aa0cf1889110620dc0d5d84066be8177fe9c2 (diff)
downloadQt-da0e1a682362144b9f13b4c564f86e09efb681bb.zip
Qt-da0e1a682362144b9f13b4c564f86e09efb681bb.tar.gz
Qt-da0e1a682362144b9f13b4c564f86e09efb681bb.tar.bz2
C++0x move operators
This makes assignement faster from temporaries, as the operator is fully inline, and doesn't do any atomic operations. Reviewed-by: joao
Diffstat (limited to 'src/gui/image/qpicture.h')
-rw-r--r--src/gui/image/qpicture.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/image/qpicture.h b/src/gui/image/qpicture.h
index 63ef42e..49b0fd6 100644
--- a/src/gui/image/qpicture.h
+++ b/src/gui/image/qpicture.h
@@ -81,6 +81,10 @@ public:
void setBoundingRect(const QRect &r);
QPicture& operator=(const QPicture &p);
+#ifdef Q_COMPILER_RVALUE_REFS
+ inline QPicture &operator=(QPicture &&other)
+ { qSwap(d_ptr, other.d_ptr); return *this; }
+#endif
void detach();
bool isDetached() const;