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
Highlighted
Developer
Posts: 126
Registered: ‎06-25-2013
My Device: Z10
My Carrier: none
Accepted Solution

NO such signal

I am getting this error.

 

Object::connect: No such signal bb::multimedia::MediaKeyWatcher::shortPress(MediaKey::VolumeUp) in ../src/EventsCall.cpp:17

 

And my code is 

#include "EventsCall.hpp"
#include <bb/multimedia/MediaKeyWatcher>
#include <bb/multimedia/MediaKey>

using namespace bb::multimedia;

EventsCall::EventsCall() {
	MediaKeyWatcher keyUp (MediaKey::VolumeUp);
	connect(&keyUp, SIGNAL(shortPress(MediaKey::VolumeUp)), this, SLOT(slotToFireOnVolumeUp()));
	connect(&keyUp, SIGNAL(longPress(MediaKey::VolumeUp)), this, SLOT(slotToFireOnVolumeUp()));
	MediaKeyWatcher keyDown (MediaKey::VolumeDown);
	connect(&keyDown, SIGNAL(shortPress(MediaKey::VolumeDown)), this,
SLOT(slotToFireOnVolumeDown())); connect(&keyDown, SIGNAL(longPress(MediaKey::VolumeDown)), this,
SLOT(slotToFireOnVolumeDown())); }

 

Is anythind wrong in coding ??

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: NO such signal

Have you tried qualifying the argument?

 

i.e. QObject::connect(&keyWatcher, SIGNAL(shortPress(bb::multimedia::MediaKey::Type))


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 126
Registered: ‎06-25-2013
My Device: Z10
My Carrier: none

Re: NO such signal

Yes, i had tried it
QObject::connect(&keyWatcher, SIGNAL(shortPress(bb::multimedia::MediaKey::VolumeUp)), ..
Developer
Posts: 52
Registered: ‎04-22-2012
My Device: Z10
My Carrier: Mobilicity

Re: NO such signal

youre using the actual value in the signal parameter.. it should be the type

 

connect(&keyWatcher,SIGNAL(shortPress(bb::multimedia::MediaKey::Type)), .. 

 NOT

connect(&keyWatcher, SIGNAL(shortPress(bb::multimedia::MediaKey::VolumeUp)), .. 

 

Developer
Posts: 126
Registered: ‎06-25-2013
My Device: Z10
My Carrier: none

Re: NO such signal

MediaKeyWatcher::~MediaKeyWatcher is called immediately after EventsCall constructor. 

So, volume key up or down press does nothing.  How to solve this ?

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: NO such signal

It's best to try to keep it to one problem one thread. As you've already closed this one off and it's been answered you will get more poeple looking at a new thread with an appropriate heading.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.