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
Contributor
zinuzoid
Posts: 11
Registered: ‎05-17-2013
My Device: Z10
Accepted Solution

DropDown signal problem?

DropDown *currency_dropdown = mSettings->findChild<DropDown*>("dropdown_currency");
Q_ASSERT(currency_dropdown);
bool ss = connect(currency_dropdown,SIGNAL(selectedValueChanged(const QVariant& selectedValue)), this,
SLOT(onSettingsCurrencyChanged(const QVariant& selectedValue)));
Q_ASSERT(ss);

i'm on 10.1.0.1020

when application lanuch i got

Object::connect: No such signal bb::cascades::DropDown::selectedValueChanged(const QVariant& selectedValue) in ../src/applicationui.cpp:276

is there any mistake on my code?

 

Thanks,

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

Re: DropDown signal problem?

bool ss = QObject::connect(currency_dropdown, SIGNAL(selectedValueChanged(QVariant)), this,
 SLOT(onSettingsCurrencyChanged(QVariant)));

This one should work.

Do not specify parameter names in SIGNAL() and SLOT(). Const and & can also be omitted when used together, MOC will discard them anyway. But it should work with them too.


Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Contributor
zinuzoid
Posts: 11
Registered: ‎05-17-2013
My Device: Z10

Re: DropDown signal problem?

It's work.

so this is little bug from ndk or just limitation or rule of qt?

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

Re: DropDown signal problem?

It's a Qt rule.

 

Btw, I've read somewhere that normalized forms (without & and const) are preferred. Just now found an interesting article describing why they are preferred:

http://marcmutz.wordpress.com/effective-qt/prefer-to-use-normalised-signalslot-signatures/

It seems non-normalized forms introduce a small runtime overhead when connecting signals to slots (the normalization is done at runtime).

 


Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Contributor
zinuzoid
Posts: 11
Registered: ‎05-17-2013
My Device: Z10

Re: DropDown signal problem?

wow that new knowlegde for me

thanks very much :Yes:

Please use plain text.