diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2016-02-25 15:35:16 +0000 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-03-16 15:49:55 +0000 |
commit | b00a98f37f57a344671fc5ab06613f1b577b5995 (patch) | |
tree | dce4566f1f35bb6ad119f97c980f9b4943c5b83d /src/core/aspects | |
parent | 851f6b874113ccfa63394906fdf32364aa732416 (diff) |
Add QAbstractAspect::onUnregistered() virtual function
Makes the API symmetric between registering and unregistering.
Also moved implementations around to be near each other.
Task-number: QTBUG-51421
Change-Id: Ia26ced9b18c62e0b88d80d599d3aaf3bb240c778
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Diffstat (limited to 'src/core/aspects')
-rw-r--r-- | src/core/aspects/qabstractaspect.cpp | 34 | ||||
-rw-r--r-- | src/core/aspects/qabstractaspect.h | 2 |
2 files changed, 26 insertions, 10 deletions
diff --git a/src/core/aspects/qabstractaspect.cpp b/src/core/aspects/qabstractaspect.cpp index 9a3ff262b..b31c29062 100644 --- a/src/core/aspects/qabstractaspect.cpp +++ b/src/core/aspects/qabstractaspect.cpp @@ -133,16 +133,6 @@ QVector<QAspectJobPtr> QAbstractAspect::jobsToExecute(qint64 time) return QVector<QAspectJobPtr>(); } -/*! - Called in the context of the aspect thread once the aspect has been registered. - This provides an opportunity for the aspect to do any initialization tasks that - require to be in the aspect thread context such as creating QObject subclasses that - must have affinity with this thread. -*/ -void QAbstractAspect::onRegistered() -{ -} - void QAbstractAspect::onCleanup() { } @@ -229,6 +219,30 @@ QVector<QAspectJobPtr> QAbstractAspectPrivate::jobsToExecute(qint64 time) } /*! + Called in the context of the aspect thread once the aspect has been registered. + This provides an opportunity for the aspect to do any initialization tasks that + require to be in the aspect thread context such as creating QObject subclasses that + must have affinity with this thread. + + \sa onUnregistered +*/ +void QAbstractAspect::onRegistered() +{ +} + +/*! + Called in the context of the aspect thread during unregistration + + of the aspect. This gives the aspect a chance to do any final pieces of + cleanup that it would not do when just changing to a new scene. + + \sa onRegistered +*/ +void QAbstractAspect::onUnregistered() +{ +} + +/*! * * Called in the QAspectThread context */ diff --git a/src/core/aspects/qabstractaspect.h b/src/core/aspects/qabstractaspect.h index e97287087..b344e5c68 100644 --- a/src/core/aspects/qabstractaspect.h +++ b/src/core/aspects/qabstractaspect.h @@ -79,6 +79,8 @@ private: virtual QVector<QAspectJobPtr> jobsToExecute(qint64 time); virtual void onRegistered(); + virtual void onUnregistered(); + virtual void onCleanup(); virtual void onStartup(); |