summaryrefslogtreecommitdiff
path: root/controller.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'controller.cxx')
-rw-r--r--controller.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/controller.cxx b/controller.cxx
new file mode 100644
index 0000000..d1271b9
--- /dev/null
+++ b/controller.cxx
@@ -0,0 +1,16 @@
+#include "worker.hxx"
+#include "controller.hxx"
+
+Controller::Controller()
+{
+ Worker* worker = new Worker{};
+ worker->moveToThread(&thread);
+ connect(&thread, &QThread::finished, worker, &QObject::deleteLater);
+ thread.start();
+}
+
+Controller::~Controller()
+{
+ thread.quit();
+ thread.wait();
+}