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.
02-07-2013 12:32 AM
Could someone kindly explain why this
QObject::connect(this->navigation_pane, SIGNAL(topChanged(Page*)), this, SLOT(onTopPageChanged(Page*)));
does not work while this
QObject::connect(this->navigation_pane, SIGNAL(topChanged(bb::cascades::Page*)), this, SLOT(onTopPageChanged(bb::cascades::Page*)));
Solved! Go to Solution.
02-07-2013 01:43 AM
02-07-2013 01:48 AM - edited 02-07-2013 01:57 AM
MOC (meta-object compiler) doesn't take presence of namespaces into account. It compares argument types as strings. As the enums are defined as fully-qualified in Cascades headers they should also be fully-qualified in connect() calls. If they weren't fully-qualified clashes could occur for enums with same names in different classes.
From Qt docs:
Enums and Typedefs Must Be Fully Qualified for Signal and Slot Parameters
When checking the signatures of its arguments, QObject::connect() compares the data types literally. Thus, Alignment and Qt::Alignment are treated as two distinct types. To work around this limitation, make sure to fully qualify the data types when declaring signals and slots, and when establishing connections.
p.s. About the class names:
Names registered in qRegisterMetaType should be fully qualified otherwise they won’t be recognized by qvariant_cast. Cascades use fully-qualified class names so they should also be fully-qualified in signals declaration. 'using namespace' won't help with signal arguments, MOC will ignore it.
02-07-2013 02:08 AM
@strobejb Of cause I have "using namespace bb::cascades;" declared. Otherwise it would just result in a compile error. No, both versions compile, the difference is only noticable at runtime.