blob: 9980f62a2d16f20621f0a84e95f36f2752c8691e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#ifndef LISTENER_H
#define LISTENER_H
#include <contextproperty.h>
#include <QDebug>
class Listener : public QObject
{
Q_OBJECT
public:
Listener()
{
cp = new ContextProperty("test.int");
connect(cp, SIGNAL(valueChanged()), this, SLOT(onValueChanged()));
}
ContextProperty* cp;
public slots:
void onValueChanged()
{
qDebug() << "Listener::valueChanged()";
qDebug() << "The value is:" << cp->value();
exit(1);
}
};
#endif
|