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
Curahee
Posts: 224
Registered: ‎01-12-2013
My Device: z30

Static asset selection in C++

Hello Developers

 

I need to do some asset selection in order to run fluently on the Q10. I have an image in C++ and I set it as icon in my progressdialog

 

progressDialog->setIcon(QUrl("asset:///images/synchronize.png"));

 The documentation on static asset selection says

 

It's important to note that the other QML files and C++ files in your app don't need to change to accommodate this folder structure. 

So to me, it looks like I don't have to do anything in order to pick the right asset in the correct folder. I have a 720x720/images folder but he does not pick the right image.

 

Someone has a solution for this?

 

Thanks in advance!

______________________________________________________
beRail: BlackBerry World - GitHub
Mobile Vikings: BlackBerry World - GitHub
Park in Brussels: BlackBerry World
Please use plain text.
Developer
dishooom
Posts: 103
Registered: ‎12-31-2012
My Device: Blackberry 9810

Re: Static asset selection in C++

The static asset selector would ve chosen the image in itsef had you placed it in the root of the assets folder. However, in your case, the synchronize.png image is within a seperate images folder, and hence not statically selected.

 

Try moving the image to root of the asset folder..... It should solve by itself.

 

_Dishooom

Please use plain text.
Developer
Curahee
Posts: 224
Registered: ‎01-12-2013
My Device: z30

Re: Static asset selection in C++

It is possible to use a subfolder as long as the images are both in the same subfolder.

 

/assets/images

/assets/720x720/images

 

But I tried what you've said, because maybe C++ has their own way of handling asset selection (with QML it is possible to use subfolders).

 

But it does not work when I place them in the root...

______________________________________________________
beRail: BlackBerry World - GitHub
Mobile Vikings: BlackBerry World - GitHub
Park in Brussels: BlackBerry World
Please use plain text.
Developer
helex
Posts: 291
Registered: ‎02-14-2012
My Device: Nokia N950 / BB Playbook

Re: Static asset selection in C++

Have you a solution for this in the meantime? Does it work if you place this into the QML file?

 

Maybe the asset selector works only for QML but not for C++ code.

Please use plain text.