Re: [SailfishDevel] QtMobility and Python bindings

2013-07-19 Thread FIlip Kłębczyk

W dniu 18.07.2013 23:55, Martin Kolman pisze:

Indeed, the news from THP look good. I've heard about PyOtherSide
earlier, but it looked like a very limited proof of concept. Now it
looks quite a bit more real. :)


Let's wait for the release. Anyway I've told that someone (from Jolla) 
will do something to allow Qt5 + Python apps to run on Nemo/Sailfish, 
but I haven't thought Thomas will be so quick with that.


Regards,
Filip
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] QtMobility and Python bindings

2013-07-18 Thread Martin Kolman

18.7.2013 08:12, FIlip Kłębczyk:
Martin, I don't believe it will be left that way till phone launch. 
Somehow I have a feeling that someone, maybe even from Jolla ;) will 
help create PySide Qt5 bindings.


Regards,
Filip
Indeed, the news from THP look good. I've heard about PyOtherSide 
earlier, but it looked like a very limited proof of concept. Now it 
looks quite a bit more real. :)


Also the points he makes[1] are very good - most Python & QML 
applications use very little of the Qt machinery, but the the bindings 
normally bind it all, leading to long startup time & big size of the 
bindings (making things worse on platforms where all additional stuff 
needs to be bundled, such as on Android or BB10). I actually have a 
"policy" of sort when working on my applications, to place as much 
functionality as possible to the GUI & platform independent Python core. 
The GUI/s should be just a thin layer visualizing the data models from 
the core to the user. PyOtherSide as described so far seems to be a 
perfect fit in this regard. :)


In short what such a GUI layer needs:
* sending data (numbers, strings, etc.) from Python to QML and from QML 
to Python
* some sort of signals to notify the GUI about events in Python 
(download finished) and Python about events in QML ("search" button clicked)
* loading images from Python to QML - from files & file-like objects 
residing in memory
* shared data models - this is kinda optional, as it could be hacked 
together from data passing and signals, but having it built in would be 
kinda nice


I guess that's basically it - once this work in some form, we are good 
to go. :)


One issue could be vector drawing, which is IIRC currently handled by 
sublassing the declarative item and drawing to it with QPainter. No sure 
how this would work with the PyOtherSide asynchronous mode of operation. 
But there should be some canvas like drawing mechanism in QtQuick 2.0 
and worst case, one can still just draw PNGs to file like objects with 
pycairo and pass it to QML. :)


BTW, PyOtherSide reminds me a bit about the Tart project[3][4] started 
by Peter Hansen to provide bindings for Cascades on BB10, not sure if it 
the project is still active though.


Best wishes
Martin

[1] https://twitter.com/thp4/status/357849906750316544
[2] 
http://thpmaemo.blogspot.cz/2013/07/the-way-forward-with-python-on-qt-5.html

[3] http://hg.microcode.ca/blackberry-py/src
[4] http://peterhansen.ca/blog/blackberry-tart-preview.html



___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] QtMobility and Python bindings

2013-07-18 Thread FIlip Kłębczyk
So it looks like the problem with Python, Qt5 is solved. See Thomas 
Perl's latest tweet about pyotherside. Good thing is that you will be 
also able to use Python code in QML.


Best regards,
Filip
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] QtMobility and Python bindings

2013-07-17 Thread FIlip Kłębczyk

W dniu 17.07.2013 21:12, Martin Kolman pisze:

Still there might be some near future hurdles for Sailfish application
development with Python. Jolla announced a few days ago that the first
Sailfish running device will be running Wayland and Qt5 only[3][4],
dropping X11 and with it Qt4 support. This is unfortunately quite an
issue for Python application development, as there are currently no
Python bindings supporting Qt5 & QtQuick 1.0 or 2.0[5]. Also, all Python
applications that were already ported to Sailfish using the current SDK
won't run in their current form, leading to some wasted effort.


Martin, I don't believe it will be left that way till phone launch. 
Somehow I have a feeling that someone, maybe even from Jolla ;) will 
help create PySide Qt5 bindings.


Regards,
Filip
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] QtMobility and Python bindings

2013-07-17 Thread Osmo Salomaa
17.07.2013 22:12, Martin Kolman wrote:
> The pyside-qtmobility build[1] I have in home:MartinK:nemo project
> or Mer OBS worked last time I've tried it.

Thanks. Importing QtMobility at a Python prompt works.

What I was planning on doing first was trying out QGraphicsGeoMap. The
(unnecessarily complicated) example [1] I found segfaults already at the
QtMobility imports. Being a Python programmer, investigating import-time
segfaults isn't really my thing.

[1]
http://qt.gitorious.org/pyside/pyside-examples/blobs/master/mobility/location/mapviewer.py

> Jolla announced a few days ago that the first Sailfish running device
> will be running Wayland and Qt5 only[3][4], dropping X11 and with it
> Qt4 support. This is unfortunately quite an issue for Python
> application development, as there are currently no Python bindings
> supporting Qt5 & QtQuick 1.0 or 2.0[5].

> Hopefully, the situation might improve on PyQt get's QtQuick 2.0
> support (no timeline for that just yet though), but PyQt packaging
> and PySide -> PyQt conversion would still be needed. Also in contrast
> to the LGPL PySide, PyQt is GPL only, which might be an issue to some
> developers.

> In comparison, while there has been some recent activity in the
> PySide project, it has been so far limited to bugfixing and work on
> Qt5 support has not yet been started.

Not being familiar with Qt, I thought (or hoped) Nokia's weight had
already resolved the Python binding problem and that PySide was somewhat
an official and maintained part of Qt. I guess I was wrong. A useless
battle continues.

I guess I better hold off on writing any Python code. In addition to
what you mention, I suppose there's a switch to Python 3 around the
corner (or at least should be by now).

-- 
Osmo Salomaa 
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] QtMobility and Python bindings

2013-07-17 Thread Martin Kolman

17.7.2013 16:54, Osmo Salomaa:

Hello friends,

I have taken a look at the Sailfish SDK with the intent of investigating
prospects of developing applications in Python. I didn't manage to find
the Python bindings for QtMobility using zypper and the default SDK
repositories. I also tried to find them for my desktop system running
Debian unstable, but it seems Debian removed pyside-mobility a year ago
due to being dead upstream and failing to build from source [1].

So, what's the status of QtMobility and Python? Has someone picked up
maintainership? Will it be included in a newer version of the Sailfish
SDK? Is there a development repository where I could find this kind of
stuff (like extras-devel was at Maemo)?

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=671356

The pyside-qtmobility build[1] I have in home:MartinK:nemo project or 
Mer OBS worked last time I've tried it.
By "worked", I mean at least the screen blanking control worked and I 
couldn't really test the rest due to missing support for GPS in Nemo.
If it works for you, I guess the package could be submitted to one of 
the Nemo or Mer repositories.


There is also a possible workaround/dirty-hack for missing 
python-qtmobility bindings - some of the QtMobility APIs are also 
available to QML. It is possible to wrap the API in QML with a custom 
element and then from Python grab this element from the QML context and 
use it. This is how AGTL[2] was using the GPS last time I looked at it's 
source code.


Still there might be some near future hurdles for Sailfish application 
development with Python. Jolla announced a few days ago that the first 
Sailfish running device will be running Wayland and Qt5 only[3][4], 
dropping X11 and with it Qt4 support. This is unfortunately quite an 
issue for Python application development, as there are currently no 
Python bindings supporting Qt5 & QtQuick 1.0 or 2.0[5]. Also, all Python 
applications that were already ported to Sailfish using the current SDK 
won't run in their current form, leading to some wasted effort.


Hopefully, the situation might improve on PyQt get's QtQuick 2.0 support 
(no timeline for that just yet though), but PyQt packaging and PySide -> 
PyQt conversion would still be needed. Also in contrast to the LGPL 
PySide, PyQt is GPL only, which might be an issue to some developers.


In comparison, while there has been some recent activity in the PySide 
project, it has been so far limited to bugfixing and work on Qt5 support 
has not yet been started.



[1] 
https://build.merproject.org/package/show?package=python-qtmobility&project=home%3AMartinK%3Anemo

[2] https://github.com/webhamster/advancedcaching
[3] https://twitter.com/cybette/status/356033983588478976
[4] https://twitter.com/JollaHQ/status/356061760089890816
[5] 
http://pyqt.sourceforge.net/Docs/PyQt5/pyqt4_differences.html#qtdeclarative-module

___
SailfishOS.org Devel mailing list


[SailfishDevel] QtMobility and Python bindings

2013-07-17 Thread Osmo Salomaa
Hello friends,

I have taken a look at the Sailfish SDK with the intent of investigating
prospects of developing applications in Python. I didn't manage to find
the Python bindings for QtMobility using zypper and the default SDK
repositories. I also tried to find them for my desktop system running
Debian unstable, but it seems Debian removed pyside-mobility a year ago
due to being dead upstream and failing to build from source [1].

So, what's the status of QtMobility and Python? Has someone picked up
maintainership? Will it be included in a newer version of the Sailfish
SDK? Is there a development repository where I could find this kind of
stuff (like extras-devel was at Maemo)?

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=671356

-- 
Osmo Salomaa 
___
SailfishOS.org Devel mailing list