[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!":http://wiki.qt-project.org/QNX
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:
@
<env var="QT_DEBUG_PLUGINS" value="1"/>
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
<env var="QT_QPA_FONTDIR" value="/usr/fonts/font_repository/liberation"/>
<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 -
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:
@
<env var="QML_IMPORT_PATH" value="app/native/imports"/>
<env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
@Good luck and enjoy Qt on the Playbook!
-
Thanks for the tips Zap!
That did the trick! I added:
@<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:
@-e $$[QT_INSTALL_PLUGINS]/imageformats/libqgif.so lib/plugins/imageformats/libqgif.so@
Then add the path in the descriptor:
@<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 -
Glad that got it sorted. Happy hacking!
-
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:
@
TARGET = testAdd more folders to ship with the application, here
folder_01.source = qml/componentsTest
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01Additional import path used to resolve QML modules in Creator's code model
QML_IMPORT_PATH =
QMAKE_LFLAGS += '-Wl,-rpath,'./app/native/lib' '
package.target = $${TARGET}.bar
package.depends = $$TARGET
package.commands = blackberry-nativepackager
-package $${TARGET}.bar -arg -platform -arg blackberry
-arg -platformpluginpath -arg ./app/native/lib/platforms
blackberry-tablet.xml $$TARGET
-e icon.png res/icon.png
-e $$[QT_INSTALL_LIBS]/libQtCore.so.4 lib/libQtCore.so.4
-e $$[QT_INSTALL_LIBS]/libQtGui.so.4 lib/libQtGui.so.4
-e $$[QT_INSTALL_LIBS]/libQtOpenGL.so.4 lib/libQtOpenGL.so.4
-e $$[QT_INSTALL_LIBS]/libQtNetwork.so.4 lib/libQtNetwork.so.4
-e $$[QT_INSTALL_LIBS]/libQtDeclarative.so.4 lib/libQtDeclarative.so.4
-e $$[QT_INSTALL_LIBS]/libQtSql.so.4 lib/libQtSql.so.4
-e $$[QT_INSTALL_LIBS]/libQtSvg.so.4 lib/libQtSvg.so.4
-e $$[QT_INSTALL_LIBS]/libQtScript.so.4 lib/libQtScript.so.4
-e $$[QT_INSTALL_LIBS]/libQtXmlPatterns.so.4 lib/libQtXmlPatterns.so.4
-e $$[QT_INSTALL_PLUGINS]/platforms/libblackberry.so lib/platforms/libblackberry.so
QMAKE_EXTRA_TARGETS += packageThe .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp
Please do not modify the following two lines. Required for deployment.
include(qmlapplicationviewer/qmlapplicationviewer.pri)
qtcAddDeployment()OTHER_FILES +=
blackberry-tablet.xml
@
And here is my descriptor xml:
@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<qnx >
<id>de.nebulon.qmlshowcase</id>
<filename>test</filename>
<name>test</name>
<versionNumber>1.0.3</versionNumber>
<description>QML Example Application</description>
<copyright>2012</copyright>
<initialWindow>
<systemChrome>none</systemChrome>
<transparent>false</transparent>
<autoOrients>true</autoOrients>
<aspectRatio>landscape</aspectRatio>
</initialWindow>
<publisher>yourURL.com</publisher>
<permission system="true">run_native</permission>
<category>core.games</category>
<icon><image>res/icon.png</image></icon><env var="QT_DEBUG_PLUGINS" value="1"/>
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
<env var="QT_QPA_FONTDIR" value="/usr/fonts/font_repository/liberation"/>
<env var="QT_QPA_PLATFORM_PLUGIN_PATH" value="app/lib/platforms"/>
<env var="QML_IMPORT_PATH" value="app/native/imports"/>
<env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
</qnx>@
Any guidance would be greatly appreciated!
Cheers,
Jon -
I missed the obvious!
Just add @-e qml qml @ to the bar package section of the pro file and adjust the path to main.qml in main.cpp @viewer->setMainQmlFile(QLatin1String("app/native/qml/<app name>/main.qml"));@
Cheers,
Jon