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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 11
Registered: ‎05-17-2013
My Device: Z10
My Carrier: AIS
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,

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

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

Re: DropDown signal problem?

It's work.

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

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

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

Re: DropDown signal problem?

wow that new knowlegde for me

thanks very much