12-20-2011 10:38 AM
01-04-2012 12:18 AM
According to QT source code (I went that far) you can specify path to platforms in two ways:
1) set up env variable QT_QPA_PLATFORM_PLUGIN_PATH accordingly ( to app/native/lib/platforms)
2) pass an argument -platformpluginpath app/native/lib/platforms (in addition to --platform blackberry)
Nevertheless neither method works for me on simulator
I always get the message "Failed to load platform plugin "blackberry". Available platforms are: "
And clicking on Debug does copy libblackberry.so to Simulator:
$ ls -l /apps/com.BGmot.QTHelloWorld.testDev_THelloWorldb7010191/native/lib/platforms/ total 430 -rwxr-x--- 1 apps dev4 219972 Dec 15 16:57 libblackberry.so
I am lost at this point -(
PS: my development platform is Mac.
01-05-2012 11:19 AM
Further investigation showed that plugins by default are loaded from $LD_LIBRARY_PATH/platforms. $LD_LIBRARY_PATH=app/native/lib - it is set up in Environment section of debug session in NDK so you do not need to specify either QT_QPA_PLATFORM_PLUGIN_PATH or -platformpluginpath.
My problem with loading libblackberry.so was that it requires at least these libraries to be deployed to Simulator:
libQtGui.so.4
libQtCore.so.4
libQtOpenGL.so.4
Trying to minimize number of libraries I was not deploying OpenGL as soon as I added it the problem got resolved. -)
PS: when you troubleshooting platform plugins loading issues you can set QT_DEBUG_PLUGINS variable to 1 which will bring lots of useful debug info to your console ;-)
02-05-2012 12:39 PM
Hi All,
With reference to: http://hecgeek.blogspot.com/2011/10/qt-for-blackbe
Here is what I've done to make it work:
First of all:
You no longer need libbbsupport.so, so remove the line LIBS += -lbbsupport from the .pro file.
Finally:
Add the following to the .xml file:
< 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" / >
That is it folks!
Tested with lates Git snapshot from Blackberry's Qt repo, as of this date (5/Feb/2012).
02-10-2012 09:18 AM
< env var="QT_DEBUG_PLUGINS" value="1" / > is useful only for debugging, if you app starts ok then remove it, it dumps debug information to console that you do not generally need.
02-10-2012 04:07 PM
If your app utilizes gif or jpg images you will also need to add the image format plugins as follows:
Package the plugins via the pro file:
-e $$[QT_INSTALL_PLUGINS]/imageformats/libqgif.so lib/plugins/imageformats/libqgif.so
and then add a variable to the descriptor xml like this:
<env var="QT_PLUGIN_PATH" value="app/native/lib/plugins"/>
If you need jpg support add the libqjpg.so the way to the imageformats folder.
Cheers,
Jon
11-25-2012 06:30 PM
Hi,
Thanks for your help. Just a minor comment, I tried using:
<env var="QT_QPA_PLATFORM_PLUGIN_PATH" value="app/lib/platforms" />
but it didn't work for me. Instead I used:
<env var="QT_QPA_PLATFORM_PLUGIN_PATH" value="app/native/lib/platforms" />
Regards,
Tom