aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickwindow_p.h
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@sletta.org>2014-08-23 14:13:05 +0200
committerGunnar Sletta <gunnar@sletta.org>2014-08-24 08:32:14 +0200
commit3f117a3901c06dbc543171646acd55b0a047b305 (patch)
treef7f75f60cc3b365541b53ec854889d43412f46f5 /src/quick/items/qquickwindow_p.h
parent441dca459286d5ab033be403f381c0914c6f74f9 (diff)
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 <laszlo.agocs@digia.com>
Diffstat (limited to 'src/quick/items/qquickwindow_p.h')
-rw-r--r--src/quick/items/qquickwindow_p.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index c8f156ed37..f33e366acb 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -62,6 +62,7 @@
#include <QtCore/qthread.h>
#include <QtCore/qmutex.h>
#include <QtCore/qwaitcondition.h>
+#include <QtCore/qrunnable.h>
#include <private/qwindow_p.h>
#include <private/qopengl_p.h>
#include <qopenglcontext.h>
@@ -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