From de8a9dee5aa7c8db3b390c9a19f65c919d201c3c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 25 Jul 2014 23:17:55 +0200 Subject: QPalette: add move constructor As with many other implicitly shared classes, efficient move semantics requires setting the d-pointer to nullptr, which then needs to be checked for in the dtor and the copy assignment operator. Change-Id: I654d181a1dfdd9a16e2f9fb96b57475cdd0b4561 Reviewed-by: J-P Nurmi Reviewed-by: Olivier Goffart --- src/gui/kernel/qpalette.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui/kernel/qpalette.h') diff --git a/src/gui/kernel/qpalette.h b/src/gui/kernel/qpalette.h index 8d9754d388..8c344be1e6 100644 --- a/src/gui/kernel/qpalette.h +++ b/src/gui/kernel/qpalette.h @@ -70,6 +70,8 @@ public: ~QPalette(); QPalette &operator=(const QPalette &palette); #ifdef Q_COMPILER_RVALUE_REFS + QPalette(QPalette &&other) Q_DECL_NOTHROW + : d(other.d), data(other.data) { other.d = Q_NULLPTR; } inline QPalette &operator=(QPalette &&other) { for_faster_swapping_dont_use = other.for_faster_swapping_dont_use; -- cgit v1.2.3