summaryrefslogtreecommitdiff
path: root/examples/qtobject/testobject.cpp
blob: e18dbc04d5f72f33d82e6c92aed7b65905ed12f1 (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
31
32
33
34
35
36
#include "testobject.h"

TestObject::TestObject(QObject *parent) :
    QObject(parent)
  , p1("Hello World")
{
    connect(&timer, SIGNAL(timeout()), this, SIGNAL(timeout()));
}

QString TestObject::debugMe(const QString& data)
{
    qWarning() << data;
    return QString("OK from %1: %2").arg(objectName()).arg(data);
}

void TestObject::setProp1(const QString& s)
{
    p1 = s;
    qWarning() << __func__ << p1;
    emit sig1(1, 0.5, QStringLiteral("asdf"));
    emit prop1Changed();
}

void TestObject::setProp2(const QString& s)
{
    p2 = s;
    qWarning() << __func__ << p2;
    emit sig2();
    emit prop2Changed(s);
}

QString TestObject::manyArgs(int a, float b, const QString& c) const
{
    qDebug() << a << b << c;
    return c;
}