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
sanj1504
Posts: 108
Registered: ‎06-25-2013
My Device: Z10
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 ??

Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

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. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
sanj1504
Posts: 108
Registered: ‎06-25-2013
My Device: Z10

Re: NO such signal

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

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)), .. 

 

Please use plain text.
Developer
sanj1504
Posts: 108
Registered: ‎06-25-2013
My Device: Z10

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 ?

Please use plain text.
Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

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. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.