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
Posts: 407
Registered: ‎06-03-2010
My Device: Z10 Red
Accepted Solution

10.2 qmlRegisterType

Hi,

 

I call qmlRegisterType in the main.cpp to register my C++ CustomControl, it worked well with the previous release:

 

qmlRegisterType<MyImageView>("mypackage.bb10", 1, 0, "MyImageView");

 

 

But with the Momentics 10.2 version, any file in QML that use MyImageView is now in red making the build fail with this error:

Type mismatch of value of the 'controls' property. Expecting bb::cascades::Control[] and found MyImageView

 

 

Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: 10.2 qmlRegisterType

Developer
Posts: 16,575
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: 10.2 qmlRegisterType

I switched back to my old Momentics. Not a solution, but a workaround.
Large parts of my QML were colored red due to custom controls.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 284
Registered: ‎08-06-2010
My Device: Z10

Re: 10.2 qmlRegisterType

Not a great workaround, but can you just close your main.cpp, delete the error markers and then build?



Follow me on twitter @RileyGB - https://twitter.com/RileyGB
View my BB10 OpenSource projects - https://github.com/RileyGB/BlackBerry10-Samples
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: 10.2 qmlRegisterType

[ Edited ]

Is there a reason to build for 10.2 (or are you just trying to get ahead of the game? :smileyhappy:)

 

Simon, you can still use the new Momentics with the older 10.1 sdk, so no reason to go back to the older Momentics, apart from maybe...

 

One problem I'm seeing with the new beta is that QML files are showing up blank with no apparent reason and no error message while others work fine.

 

Apart from this though I've had relatively few problems building to 10.1 on the new beta.

 


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.
Developer
Posts: 407
Registered: ‎06-03-2010
My Device: Z10 Red

Re: 10.2 qmlRegisterType

Thanks, but no it doesn't work, the error markers are created again.

New Contributor
Posts: 4
Registered: ‎06-19-2013
My Device: Z10

Re: 10.2 qmlRegisterType

[ Edited ]

The new IDE still shows QML errors when building with 10.1. This makes me unwilling to use the new IDE - although my app still builds and runs correctly, have "errors" in the code doesn't fill me with confidence.

BlackBerry Development Advisor
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: 10.2 qmlRegisterType

You can disable qml errors

Preferences > BlackBerry > QML Editor > Errors/Warnings

Developer
Posts: 16,575
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: 10.2 qmlRegisterType


elena_laskavaia wrote:

You can disable qml errors

Preferences > BlackBerry > QML Editor > Errors/Warnings


That is a bit too much for my taste, it is helpful to get an error in qml if you do something wrong.

 

It took some time to get used to the (incorrect) qml errors in the 10.1 momentics, but 10.2 shows a dozen more and makes it unusable.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 407
Registered: ‎06-03-2010
My Device: Z10 Red

Re: 10.2 qmlRegisterType

Setting all Error level to Warning did not change the build status.

 

But, I think I almost found it. Go to:

Preferences > BlackBerry > QML Editor > QML Code Template

 

Then add your template, from a existing one  (ImageView for exemple).

The QML is still red, but the project now build. 

 

 

(I stil cannot deploy because the new Momentics is not referring to the embedded JRE but to a too old one.)