View Single Post
Posts: 9 | Thanked: 2 times | Joined on Apr 2010 @ Brno, Czech republic
#1
Hello all,
I'm started develop one application which use Qt, QDBus for display incoming call. I try connect to com.nokia.csd.Call via QDBusConnection. This connection is OK, I receive TRUE. But if I call to my phone from other phone, incomming call isn't displayed!

See below for my code.

My class is:

class MyClass : public QObject
{
Q_OBJECT

public:
MyClass(QObject *parent = 0);
~MyClass(){}

public slots:
void receiveCall(QString path, QString callNum);
}


method "receiveCall" is implemented as:

void MyClass::receiveCall(QString path, QString callNum)
{
QLabel label;
...
label.show();
label.setText("Incoming call: " + path + " " + callNum);
}


In main.cpp:

static QDBusConnection conn = QDBusConnection::systemBus();

int main(int argc, char *argv[])
{
QApplication a(argc, argv);

QLabel label;
....

MyClass *mycall = new MyClass();
bool result = conn.connect("com.nokia.csd.Call", "/com/nokia/csd/call", "com.nokia.csd.Call", "Coming", mycall, SLOT(receiveCall(QString,QString)));

if(result)
{
label.setText("DBus connected OK!");
}
else
{
label.setText("DBus connected ERROR!");
}

return a.exec();
}


After start application I see text "DBus connected OK!". When I call to phone with application, so no label with text "Incoming call: ..." isn't see. Where is problem? Where do I error?

Thanks all

Last edited by prklic; 2010-04-22 at 11:02.