February 9, 2012

Jon Heron Jon Heron
Lab Rat
6 posts

[solved] Deploying to Blackberry Playbook

 

Hello All,

I have successfully deployed a couple Qt widget based apps to the playbook now. They need some styling but overall they run smooth and are functional!
Thanks for the QNX wiki! [wiki.qt-project.org]
I found that I needed to add the following to my blackberry-tablet.xml to get it to run on the playbook SDK 2.0 beta2 and OS2.0 Beta on the playbook:

  1. <env var="QT_DEBUG_PLUGINS" value="1"/>
  2. <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
  3. <env var="QT_QPA_FONTDIR" value="/usr/fonts/font_repository/liberation"/>
  4. <env var="QT_QPA_PLATFORM_PLUGIN_PATH" value="app/lib/platforms"/>

I have a couple questions:
I have an application that utilizes many gif images. However, the gif’s aren’t being displayed on the playbook.
I added this line to my pro file to put the gif plugin into the package:
-e $$[QT_INSTALL_PLUGINS]/imageformats/libqgif.so lib/imageformats/libqgif.so
And this to main.cpp: a.addLibraryPath(”/lib”);
I can see the plugin inside the bar file @ /native/lib/imageformats. I have also tried /native/lib and /native all with the same result, no gif images displayed.
Perhaps I need to set another variable to a QPA path in the blackberry-tablet.xml? I have been unsuccessful at finding any documentation about the QPA flags…
Any advice or direction would be appreciated!
Cheers,
Jon

5 replies

February 9, 2012

ZapB ZapB
Gene Splicer
1206 posts

Hi! I too have had no luck with using gifs on the playbook. To be honest I did not try very hard and simply switched to using png’s instead.

When you come to try to use QML on the Playbook you will also need to set an environment variable so that the QML runtime can locate your qml files. I typically set the following in the bar descriptor xml file:

  1. <env var="QML_IMPORT_PATH" value="app/native/imports"/>
  2. <env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
  3. <env var="LD_LIBRARY_PATH" value="app/native/lib"/>

Good luck and enjoy Qt on the Playbook!

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

February 9, 2012

Jon Heron Jon Heron
Lab Rat
6 posts

Thanks for the tips Zap!
That did the trick! I added:

  1. <env var="QT_PLUGIN_PATH" value="app/native/plugins"/>

To my descriptor xml and now all the gifs are working perfect.
To Recap;
Add libqgif.so plugin into the package by adding this line to your pro:

  1. -e $$[QT_INSTALL_PLUGINS]/imageformats/libqgif.so lib/plugins/imageformats/libqgif.so

Then add the path in the descriptor:
  1. <env var="QT_PLUGIN_PATH" value="app/native/lib/plugins"/>

If jpg support is needed add the libqjpg.so plugin the same way…
Cheers!
Jon

February 9, 2012

ZapB ZapB
Gene Splicer
1206 posts

Glad that got it sorted. Happy hacking!

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

February 14, 2012

Jon Heron Jon Heron
Lab Rat
6 posts

I have now started to play with qml on the playbook! :)
Its not going so well, I get a white screen, likely because it cant find the qml files…
I added the variables as you suggested above but I am not seeing the “imports” folder in the Bar file.
Are you manually packaging the qml/ folder into the bar package via the pro file somehow?
Here is what my pro file looks like for the test:

  1. TARGET = test
  2. # Add more folders to ship with the application, here
  3. folder_01.source = qml/componentsTest
  4. folder_01.target = qml
  5. DEPLOYMENTFOLDERS = folder_01
  6.  
  7. # Additional import path used to resolve QML modules in Creator's code model
  8. QML_IMPORT_PATH =
  9.  
  10. QMAKE_LFLAGS += '-Wl,-rpath,\'./app/native/lib\' '
  11. package.target = $${TARGET}.bar
  12. package.depends = $$TARGET
  13. package.commands = blackberry-nativepackager \
  14.    -package $${TARGET}.bar -arg -platform -arg blackberry \
  15.    -arg -platformpluginpath -arg ./app/native/lib/platforms \
  16.    blackberry-tablet.xml $$TARGET \
  17.    -e icon.png res/icon.png \
  18.    -e $$[QT_INSTALL_LIBS]/libQtCore.so.4 lib/libQtCore.so.4 \
  19.    -e $$[QT_INSTALL_LIBS]/libQtGui.so.4 lib/libQtGui.so.4 \
  20.    -e $$[QT_INSTALL_LIBS]/libQtOpenGL.so.4 lib/libQtOpenGL.so.4 \
  21.    -e $$[QT_INSTALL_LIBS]/libQtNetwork.so.4 lib/libQtNetwork.so.4 \
  22.    -e $$[QT_INSTALL_LIBS]/libQtDeclarative.so.4 lib/libQtDeclarative.so.4 \
  23.    -e $$[QT_INSTALL_LIBS]/libQtSql.so.4 lib/libQtSql.so.4 \
  24.    -e $$[QT_INSTALL_LIBS]/libQtSvg.so.4 lib/libQtSvg.so.4 \
  25.    -e $$[QT_INSTALL_LIBS]/libQtScript.so.4 lib/libQtScript.so.4 \
  26.    -e $$[QT_INSTALL_LIBS]/libQtXmlPatterns.so.4 lib/libQtXmlPatterns.so.4 \
  27.    -e $$[QT_INSTALL_PLUGINS]/platforms/libblackberry.so lib/platforms/libblackberry.so
  28. QMAKE_EXTRA_TARGETS += package
  29.  
  30.  
  31. # The .cpp file which was generated for your project. Feel free to hack it.
  32. SOURCES += main.cpp
  33.  
  34. # Please do not modify the following two lines. Required for deployment.
  35. include(qmlapplicationviewer/qmlapplicationviewer.pri)
  36. qtcAddDeployment()
  37.  
  38. OTHER_FILES += \
  39.     blackberry-tablet.xml

And here is my descriptor xml:
  1. <?xml version="1.0" encoding="utf-8" standalone="no"?>
  2. <qnx >
  3. <id>de.nebulon.qmlshowcase</id>
  4. <filename>test</filename>
  5. <name>test</name>
  6. <versionNumber>1.0.3</versionNumber>
  7. <description>QML Example Application</description>
  8. <copyright>2012</copyright>
  9. <initialWindow>
  10.   <systemChrome>none</systemChrome>
  11.   <transparent>false</transparent>
  12.   <autoOrients>true</autoOrients>
  13.   <aspectRatio>landscape</aspectRatio>
  14. </initialWindow>
  15. <publisher>yourURL.com</publisher>
  16. <permission system="true">run_native</permission>
  17. <category>core.games</category>
  18. <icon><image>res/icon.png</image></icon>
  19.  
  20. <env var="QT_DEBUG_PLUGINS" value="1"/>
  21. <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
  22. <env var="QT_QPA_FONTDIR" value="/usr/fonts/font_repository/liberation"/>
  23. <env var="QT_QPA_PLATFORM_PLUGIN_PATH" value="app/lib/platforms"/>
  24. <env var="QML_IMPORT_PATH" value="app/native/imports"/>
  25. <env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
  26. </qnx>

Any guidance would be greatly appreciated!
Cheers,
Jon

February 16, 2012

Jon Heron Jon Heron
Lab Rat
6 posts

I missed the obvious!
Just add

  1. -e qml qml \
to the bar package section of the pro file and adjust the path to main.qml in main.cpp
  1. viewer->setMainQmlFile(QLatin1String("app/native/qml/<app name>/main.qml"));

Cheers,
Jon

 
  ‹‹ [SOLVED] Command configure doesn’t exist @ Terminal      Invalid option "win32-msvc" for -platform when trying to configure build ››

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