<div dir="ltr">You guys are awesome ! :)<br><br><div class="gmail_quote">On Mon, Jan 28, 2013 at 6:13 PM, Martin Kolman <span dir="ltr"><<a href="mailto:martin.kolman@gmail.com" target="_blank">martin.kolman@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">16.1.2013 03:06, Peter Hansen:<div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 2013-01-15 20:12, Martin Kolman wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
relevant part of the debug log for "from PySide.QtGui import QApplication":<br>
<br>
dlopen("PySide/QtGui.so", 2);<br>
ldd:FATAL: Unresolved symbol "_Z17init_QPrinterInfoP7_<u></u>object" called<br>
from QtGui.so<br>
</blockquote>
<br>
This reminds me a lot of when Ritesh and I were trying to get the basic PySide build working for the PlayBook, and had to strip out certain things that didn't look likely to be compatible.  I don't recall the specifics but you'd see signs of them in our patch files at <a href="http://hg.microcode.ca/blackberry-py/src/500d90ca1dbee18fbc58ed1921d464c39377892b/patches/02-pyside-qnx.patch?at=pyside" target="_blank">http://hg.microcode.ca/<u></u>blackberry-py/src/<u></u>500d90ca1dbee18fbc58ed1921d464<u></u>c39377892b/patches/02-pyside-<u></u>qnx.patch?at=pyside</a><br>


<br>
I just peeked there, and QSound was one of them.  I wouldn't think QPrinterInfo would have the pieces needed to support it, so stripping it out in similar fashion seems like a reasonable step.<br>
<br>
-Peter<br>
______________________________<u></u>_________________<br>
BlackBerry-Python mailing list<br>
<a href="mailto:BlackBerry-Python@engcorp.com" target="_blank">BlackBerry-Python@engcorp.com</a><br>
<a href="http://www.engcorp.com/mailman/listinfo/blackberry-python" target="_blank">http://www.engcorp.com/<u></u>mailman/listinfo/blackberry-<u></u>python</a><br>
</blockquote></div></div>
As you might have already noticed, I got PySide working and already submitted a working application (Mieru) for review to (App)World. So, how did I do that ? :)<br>
<br>
First, I would like to thank to Peter, Micke & all others who helped me here & on #bbx-python. Without you I would not have succeeded! :)<br>
<br>
<br>
<br>
Barebones PySide@BB10 howto<br>
<br>
When adapting the work PySide port for Playbook I have encountered two main issues - weird segfaults in QtGui & missing symbols.<br>
<br>
I've solved the first issue thanks to Micke by manually loading the Qt Libraries before the corressponding PySide module is loaded, like this:<div class="im"><br>
<br>
from ctypes import *<br>
qtcore = CDLL('libQtCore.so.4')<br></div><div class="im">
qtdecl = CDLL('libQtDeclarative.so.4')<br></div>
qtgui = CDLL('libQtGui.so.4')<br>
<br>
Just run this before importing modules from PySide & you are safe.<br>
<br>
After solving this issue, importing the PySide modules still resulted in segfault due to missing symbols, such as QPrinterInfo, QDeviceInfo and others. Those Classes indeed are not available in the BB10 Qt libraries.<br>


After Peters suggestion, I've solved it by progressively removing all the offending classes. The resulting modified PySide source code is here:<br>
<a href="https://github.com/M4rtinK/pyside-bb10/tree/bb10" target="_blank">https://github.com/M4rtinK/<u></u>pyside-bb10/tree/bb10</a><br>
I've also pushed Shiboken source just with the Playbook patches (any new ones were not necessary) here:<br>
<a href="https://github.com/M4rtinK/shiboken-bb10/tree/bb10" target="_blank">https://github.com/M4rtinK/<u></u>shiboken-bb10/tree/bb10</a><br>
<br>
Just grab the sources & follow the PySide for Playbook guide[1] and you should get a working PySide build for BB10. :)<br>
<br>
<br>
<br>
Using on device Qt Libraries<br>
<br>
BB10 contains a fully usable Qt 4.8.4 build, you you can skip the custom Qt build and just compile against the Qt libraries in the NDK. The resulting base package size is about 3.7 MB as only the PySide libraries need to be bundled in.<br>


<br>
<br>
<br>
Qt Components<br>
<br>
If your application requires Qt Components, you can use the Qt Components I've modified to work on the high-DPI BB10 device screen. My work is based on the Ineans Qt components clone and is available here:<br>
<a href="https://qt.gitorious.org/~martink/qt-components/martinks-ineans-qt-components/commits/bb10" target="_blank">https://qt.gitorious.org/~<u></u>martink/qt-components/<u></u>martinks-ineans-qt-components/<u></u>commits/bb10</a><br>


See the README for information how to build & use them. :)<br>
The components should be compatible with the usual com.nokia.meego 1.0 namespace and the application indeed looks basically the same as on Harmattan@Nokia N9. :)<br>
Screenshots:<br>
<a href="http://t.co/JTj6KWvj" target="_blank">http://t.co/JTj6KWvj</a><br>
or<br>
<a href="http://modrana.org/images/bb10/mieru/release_screenshots/" target="_blank">http://modrana.org/images/<u></u>bb10/mieru/release_<u></u>screenshots/</a><br>
<br>
<br>
<br>
Slow QtQuick<br>
<br>
By default, QtQuick application don't use the OpenGL viewport, which results in bad performance (only the software viewport/rasterizer is used). To enabled OpenGL, add this to you bar-descriptor.xml:<br>
<br>
<env var="QBB_USE_OPENGL" value="1"/><br>
<br>
Note that QtQuick with OpenGL is reportedly still a bit experimental and weird issues might show up. But by enabling it, you get at least the same performance as on Harmattan@N9 (which is nice, considering the much larger resolution).<br>


<br>
<br>
<br>
Mieru - a case study<br>
<br>
I managed to cram the final signed Mieru bar package to 6.9 MB<br>
The package includes:<br>
*  stripped PySide libraries<br>
*  Mieru Python (including byte-compiled files) & QML source<br>
*  stripped unrar binary<br>
*  stripped libmagic.so & 2MB (when uncompressed) magic.mgc file type recognition library library<br>
*  the above mentioned Qt Component (including Extras) with stripped plugin *.so<br>
*  cut-down Qt Components theme<br>
*  portrait splashscreen<br>
<br>
BTW, the basic package is 6.7, the signing adds about 200 kB overhead in this case.<br>
<br>
[1] <a href="http://hg.microcode.ca/blackberry-py/wiki/Building%20PySide" target="_blank">http://hg.microcode.ca/<u></u>blackberry-py/wiki/Building%<u></u>20PySide</a><br>
<br>
So that's it! :)<br>
<br>
Best wishes<span class="HOEnZb"><font color="#888888"><br>
Martin Kolman<br>
</font></span><br>
PS.: I plan to compile all this to a comprehensive online guide eventually.<div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
BlackBerry-Python mailing list<br>
<a href="mailto:BlackBerry-Python@engcorp.com" target="_blank">BlackBerry-Python@engcorp.com</a><br>
<a href="http://www.engcorp.com/mailman/listinfo/blackberry-python" target="_blank">http://www.engcorp.com/<u></u>mailman/listinfo/blackberry-<u></u>python</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Regards,<br>Tarek Galal<div><a href="http://jadb.wordpress.com" target="_blank">http://jadb.wordpress.com</a></div></div>
</div>