[SailfishDevel] SailfishOS as an OS/platform in Qt
suy at badopi.org
Thu Dec 4 16:38:45 UTC 2014
I've asked this a couple of times on IRC, but I haven't found a fully
satisfying answer. I want to see SailfishOS as any other OS/platform is
featured in Qt: by having some qmake support to detect wheter I'm compiling
for SailfishOS or not.
Once that is done, having a Q_OS_SAILFISH preprocessor macro that can also
choose different paths in C++ and adding support in QFileSelector is trivial.
The big question is: do you want such thing in Qt? If yes, I would gladly do
it myself, since I have some time available and I'm looking for ways to
contribute to Qt, learn, etc.
Right now everyone is baking its own way, with varying degrees of success. ;-)
I looked at it a year ago when I started writing my Sailfish application, and
I was pointed to puzzle-master's sources, where a simple
packagesExist(sailfishapp) did the trick... or so I thought. Since I wasn't
testing the non-Sailfish branch much, I didn't realize Creator always returns
true on this condition (by design: not allowed to fork a process when parsing
.pro files). Seems a petty complaint (who cares about Creator that much? it
works for qmake just fine), but with harbour requiring a "harbour-" prefix in
the name of the executable, Creator might not even be able to start the
application because it doesn't find it if you use a different value for
Lately I've been finding time for the app again and I finally noticed the
problem, so I asked on IRC again. I was pointed at other application, and the
check used was even worse. :-)
Then I searched a bit in the branch of the mer-qt/qtbase repo. I see you don't
use any mkspec for SailfishOS or Jolla, right? That's where I thought you
might have it, and where I think it could be. Blackberry sets there the
QMAKE_PLATFORM and Q_OS_BLACKBERRY.
Yes, yes. I know there is a solution: pass a parameter to the qmake
invocation. Store the invocation flag on the RPM packaging for final
deployment, and maybe a .pro.shared file for development. That's what Puzzle
Master has now too. Still I think there is some value in having this sorted
out in a more general way, specially given that you'll want people to also
distinguish a build for the Jolla phone or the Jolla tablet.
Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
http://barnacity.net/ | http://disperso.net
More information about the Devel