From 3f117a3901c06dbc543171646acd55b0a047b305 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Sat, 23 Aug 2014 14:13:05 +0200 Subject: [PATCH] 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 --- src/quick/items/qquickwindow_p.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 -- 2.7.4