aboutsummaryrefslogtreecommitdiff
path: root/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/multithreading-tests/wait-for-subscription-only-in-thread/thread.h')
-rw-r--r--sandbox/multithreading-tests/wait-for-subscription-only-in-thread/thread.h52
1 files changed, 0 insertions, 52 deletions
diff --git a/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/thread.h b/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/thread.h
deleted file mode 100644
index e92af6f2..00000000
--- a/sandbox/multithreading-tests/wait-for-subscription-only-in-thread/thread.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef THREAD_H
-#define THREAD_H
-
-#include <contextproperty.h>
-
-#include <QThread>
-#include <QDebug>
-
-class Listener : public QObject
-{
- Q_OBJECT
-
-public:
- Listener()
- {
- cp = new ContextProperty("test.int");
- connect(cp, SIGNAL(valueChanged()), this, SLOT(onValueChanged()));
- qDebug() << "**** Starting to wait";
- cp->waitForSubscription();
- qDebug() << "**** Waiting is done";
- qDebug() << "After waiting, the value is" << cp->value();
- sleep(1);
- qDebug() << "After waiting 1 s more, the value is" << cp->value();
-
- }
-
- ContextProperty* cp;
-
-public slots:
- void onValueChanged()
- {
- qDebug() << "Listener::valueChanged(), and current thread is" << QThread::currentThread();
- qDebug() << "The value is:" << cp->value();
-// exit(1);
- }
-};
-
-class Thread : public QThread
-{
- Q_OBJECT
-
-protected:
- void run()
- {
- qDebug() << "SUB THREAD:" << QThread::currentThread();
- Listener listener;
- exec();
- }
-
-};
-
-#endif