From: Gunnar Sletta Date: Sat, 23 Aug 2014 12:13:05 +0000 (+0200) Subject: Introduce QQuickWindowQObjectCleanupJob. X-Git-Tag: v5.3.99+beta1~132 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3f117a3901c06dbc543171646acd55b0a047b305;p=platform%2Fupstream%2Fqtdeclarative.git Introduce QQuickWindowQObjectCleanupJob. Convenience for cleaning up texture providers. Private class for now, we can maybe make it public in 5.5. Change-Id: I3489fde2a268bc988634a16f87ee558b9ac5dba2 Reviewed-by: Laszlo Agocs --- diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h index c8f156e..f33e366 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include @@ -287,6 +288,19 @@ private: bool _accepted; }; +class QQuickWindowQObjectCleanupJob : public QRunnable +{ +public: + QQuickWindowQObjectCleanupJob(QObject *o) : object(o) { } + void run() Q_DECL_OVERRIDE { delete object; } + QObject *object; + static void schedule(QQuickWindow *window, QObject *object) { + Q_ASSERT(window); + Q_ASSERT(object); + window->scheduleRenderJob(new QQuickWindowQObjectCleanupJob(object), QQuickWindow::AfterSynchronizingStage); + } +}; + Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickWindowPrivate::FocusOptions) QT_END_NAMESPACE