mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 09:15:34 +08:00
T102 Implement move constructor and move assignment for CWorkerPointer
so the connection to the worker's aboutToStart signal remains valid.
This commit is contained in:
@@ -25,10 +25,8 @@ namespace BlackMisc
|
||||
* be disconnected when the object is destroyed. So it can be used with lambdas or bind which feature
|
||||
* non QObjects, if those might be destroyed before the signaling QObject.
|
||||
*/
|
||||
class BLACKMISC_EXPORT CConnectionGuard : public QObject
|
||||
class BLACKMISC_EXPORT CConnectionGuard
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
CConnectionGuard() = default;
|
||||
@@ -36,6 +34,18 @@ namespace BlackMisc
|
||||
//! Constructor
|
||||
CConnectionGuard(const QMetaObject::Connection &connection);
|
||||
|
||||
//! Move constructor
|
||||
CConnectionGuard(CConnectionGuard &&) = default;
|
||||
|
||||
//! Move assignment operator
|
||||
CConnectionGuard &operator =(CConnectionGuard &&) = default;
|
||||
|
||||
//! Not copyable
|
||||
//! @{
|
||||
CConnectionGuard(const CConnectionGuard &) = delete;
|
||||
CConnectionGuard &operator =(const CConnectionGuard &) = delete;
|
||||
//! @}
|
||||
|
||||
//! Destructor
|
||||
~CConnectionGuard();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user