Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
tanphat1412
Posts: 125
Registered: ‎11-06-2012
My Device: BlackBerry
My Carrier: Mobifone
Accepted Solution

No such signal bb::system::phone::Phone::callUpdated error

I'm working on a project use the Phone object. It shows error when I connect the signal to a slot.

 

bb::system::phone::Phone *ph = new bb::system::phone::Phone(this);
    bool success = connect(ph, SIGNAL(callUpdated(bb::system::phone::Call&)), this, SLOT(onCallUpdated(bb::system::phone::Call&)));

It shows: "Object::connect:
No such signal bb::system::Phone::Phone::callUpdated(bb::system::Phone::Call&)"

 

Anyone know how to fix it?

Please help me. Thanks

Please use plain text.
Developer
oliver_kranz
Posts: 216
Registered: ‎09-18-2009
My Device: Z10
My Carrier: O2

Re: No such signal bb::system::phone::Phone::callUpdated error

Do you have all the includes?

#include <bb/system/phone/Phone.hpp>
#include <bb/system/phone/Call>

 Did you link against this class in your .pro file?

LIBS += -lbbsystem

 

Please use plain text.
Developer
tanphat1412
Posts: 125
Registered: ‎11-06-2012
My Device: BlackBerry
My Carrier: Mobifone

Re: No such signal bb::system::phone::Phone::callUpdated error

Yes, I already included and add library in pro file.

Please use plain text.
Developer
oliver_kranz
Posts: 216
Registered: ‎09-18-2009
My Device: Z10
My Carrier: O2

Re: No such signal bb::system::phone::Phone::callUpdated error

Maybe, add the namespace to your .hpp file.

using namespace bb::system::phone;

 

Please use plain text.
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: No such signal bb::system::phone::Phone::callUpdated error

Hi! Please try the following:

bool success = QObject::connect(p, SIGNAL(callUpdated(bb::system::phone::Call)), this, SLOT(onCallUpdated(bb::system::phone::Call)));

Declare the slot as:

	void callUpdated(const bb::system::phone::Call &call);

 


Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Developer
tanphat1412
Posts: 125
Registered: ‎11-06-2012
My Device: BlackBerry
My Carrier: Mobifone

Re: No such signal bb::system::phone::Phone::callUpdated error

I've done all of them and set access_phone permisson too. But it still shows error :smileysad:

Please use plain text.
Developer
oliver_kranz
Posts: 216
Registered: ‎09-18-2009
My Device: Z10
My Carrier: O2

Re: No such signal bb::system::phone::Phone::callUpdated error

Does your class extend QObject? You also have to add Q_OBJECT.

class YourClass: public QObject {
    Q_OBJECT
}

 

 

Please use plain text.
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: No such signal bb::system::phone::Phone::callUpdated error

[ Edited ]

Please try again the code which I've pasted. I've checked that it works. It did not work when & symbol was appended to Call.

If it still returns false please paste the .h file contents.

'using namespace' is not needed (it's ignored by MOC).


Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Developer
tanphat1412
Posts: 125
Registered: ‎11-06-2012
My Device: BlackBerry
My Carrier: Mobifone

Re: No such signal bb::system::phone::Phone::callUpdated error

[ Edited ]

This is the code, I'm using:

 

.hpp

#include <bb/system/phone/Phone>
#include <bb/system/phone/Call>
#include <bb/system/phone/CallState>

using namespace bb::system::phone;

Phone *ph;

public slots:
	void onCallUpdated(bb::system::phone::Call &call);

 .cpp

    ph = new Phone();
    bool success = QObject::connect(ph, SIGNAL(callUpdated(bb::system::phone::Call)), this, SLOT(onCallUpdated(bb::system::phone::Call)));
    if(success)
    	qDebug()<<"Phone connect success !!!";
    else
    	qDebug()<<"Phone connect fail !!!";

.pro

LIBS += -lbbsystem 

bar file

<permission>access_phone</permission>

 

 It's still not working.



Please use plain text.
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: No such signal bb::system::phone::Phone::callUpdated error

[ Edited ]

Declare the slot as:

void onCallUpdated(const bb::system::phone::Call &call);

 

const is missing.


Andrey Fidrya, @zmeyc on twitter
Please use plain text.