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
Developer
Posts: 587
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA
Accepted Solution

no matching function for call to 'bb::cascades::QmlDocument::createRootObject()'

[ Edited ]

- Existing application written for 10.0.6

- Installed 10.0.9 SDK

- Read:

  https://developer.blackberry.com/cascades/documentation/dev/upgrading/applicationchanges.html

- Now have:

 

 

	Model *model = new Model();

	QmlDocument *qml = QmlDocument::create("asset:///main.qml")
	   .property("cs", this)
	   .property("model", model);

	   if (!qml->hasErrors()) {
	       Page *page= qml->createRootObject<Page>();
	       if (page) {
	           setScene(page);
	       }
	   }

 

In my toolbar, "BlackBerry 10 Native SDK 10.0.9.386" is selected.

 

The line:

 

Page *page= qml->createRootObject<Page>();

 

... is underlined in red with the error:

 

no matching function for call to 'bb::cascades::QmlDocument::createRootObject()'

 

Previous to this, there was a line underlined in red in one of my .h files that that was complaining about an SQL related issue, but the line had nothing at all to do with SQL. I did a clean in the IDE and that went away fortunately.

Developer
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: no matching function for call to 'bb::cascades::QmlDocument::createRootObject()'

createRootObject is a template function, so it needs to be qml->createRootObject<Page>()

Like all of my posts
Developer
Posts: 587
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA

Re: no matching function for call to 'bb::cascades::QmlDocument::createRootObject()'

[ Edited ]

The forum ate the <Page> substring in that line of code... it must have interpted it as HTML. (fixed my above post)

 

I am calling it as you suggest and that is what is resulting in the error.

Developer
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: no matching function for call to 'bb::cascades::QmlDocument::createRootObject()'

Are you using the right namespace? bb::cascades and make sure you import <bb/cascades/Page>

Like all of my posts
Highlighted
Developer
Posts: 587
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA

Re: no matching function for call to 'bb::cascades::QmlDocument::createRootObject()'

Thanks Kyle, that was the primary issue.

 

The other problem is that RIM's demo code is strangely wrong: (https://developer.blackberry.com/cascades/documentation/dev/upgrading/applicationchanges.html)

 

setScene(page);

 

Should now be:

 

Application::instance()->setScene(page);

 

Kind of silly that the very page that shows you how things are supposed to work now contains code lower down that isn't consistent with what it preaches up top. Sigh.