August 6, 2011

djgtram djgtram
Lab Rat
7 posts

Embed resources *on Symbian* - is it possible?

 

I know the routine, .qrc file, referring to resources with the qrc: prefix. It all works flawlessly when I build for the desktop. However, when compiling into Symbian .sis, the resources stay outside (as dictated by the various package and other files for the toolchain). My mistake somewhere or simply not possible with a .sis package? (Environment is Qt Creator with its usual GCCE toolchain).

9 replies

August 6, 2011

Denis Kormalev Denis Kormalev
Lab Rat
1654 posts

It is possible. Look into assistant about symbian-specific .pro variables.
Also maybe you will be ok with embedding your qrc into executable binary (by adding them into RESOURCES variable)

August 7, 2011

djgtram djgtram
Lab Rat
7 posts

RESOURCES most definitely not, I have that now, this is why the desktop build is OK. Still no cigar on Symbian. I’ll check out what happened to my Assistant, when I start it, it comes up empty, only with the default text, nothing in the left pane. And the updater says I have all the documentation right here. Strange…

Found it. Am I really supposed to manually add it in Preferences, or was this an installation error? Anyway, wasn’t that hard to find, just curious…

August 7, 2011

djgtram djgtram
Lab Rat
7 posts

I finally arrived at a stage where the resources are probably embedded (without them, the EXE is smaller), still, the .sis contains them in their original form as well, so they will be deployed on the target device (in the usual folder below private). I could manually edit the package files every time, of course, but running qmake any time would undo those changes. There must be a better way for sure…

August 8, 2011

roopeshchander roopeshchand..
Lab Rat
39 posts

@djgtram Maybe they are packaged with the .sis because the files are still specified in your DEPLOYMENTFOLDERS in the .pro file?

August 8, 2011

djgtram djgtram
Lab Rat
7 posts

Bingo. I knew there had to be some solution… :-) Thanks a lot.

It was right in front of my eyes although it’s not documented in Assistant. Besides, there are problems with it: if I remove the folder, Project explorer removes the source files, so I can no longer edit them in Creator. As a workaround, I add the folder now but remove it again in the Symbian section of the .pro file. A workaround for sure but it seems to work for now.

August 8, 2011

roopeshchander roopeshchand..
Lab Rat
39 posts

np. :)
I don’t expect Qt Assistant to have anything about DEPLOYMENTFOLDERS because it’s a Qt Creator feature (which auto-generates a .pri file to handle this variable when you create a project), not really a Qt feature.

So are you saying that Qt Creator doesn’t keep qml sources in the project explorer even if they’re added as resources? Too bad.

August 8, 2011

djgtram djgtram
Lab Rat
7 posts

Assistant has a doc about qmake (well, not Assistant-specific but it comes with the SDK and Assistant can display it among all other docs). That doc does mention DEPLOYMENT but not DEPLOYMENTFOLDERS.

Yes, exactly the case. Creator tries to be too smart here, I guess. Other files (like images, SVGs) can be referenced by OTHER_FILES but I couldn’t find any other way than the workaround above to handle QML files (unless there is another undocumented qmake variable for this, of course).

August 8, 2011

roopeshchander roopeshchand..
Lab Rat
39 posts

I did consider qmake as part of Qt in my previous answer. DEPLOYMENT is a qmake feature (has a not-so-straightforward usage, though). DEPLOYMENTFOLDERS is not. The auto-generated pri file reads DEPLOYMENTFOLDERS from the .pro file and populates DEPLOYMENT.

August 8, 2011

djgtram djgtram
Lab Rat
7 posts

Yes, indeed. Well, the whole build process, going back to the old Symbian tools, is much more than convoluted but I’m neither the first nor the last one to note it… :-)

 
  ‹‹ MeeGo Qt Components: ContextMenu for a ListView item?      [Solved] Item placed below gets focus after mouse button was clicked on an item that is above ››

You must log in to post a reply. Not a member yet? Register here!