[SailfishDevel] Is running an app with qmlscene fine for harbour?

Martin Kolman martin.kolman at gmail.com
Fri Nov 1 22:28:39 UTC 2019

On 11/1/19 8:26 PM, szopin at gmail.com wrote:
> Just curious as last mention of qmlscene on tjc is from 2014 and modRana at that point was supposedly ran with it,

I think that post is mostly about how to use qmlscene during development 
of pure QML or Python + QML apps.

>   is it still ok to have .desktop file calling qmlscene or is that a no-no for harbour apps even for pure qml apps?

I think you are supposed to use the "sailfish-qml" tool in such a case, see:


I think this is really the only way or at least it was when I did 
initially package modRana years ago. I would definitely use qmlscene if 
I could, as sailfish-qml

imposes various more or less brain-dead limitations on your application, 
like where you main qml file need to be located, how it needs to be 
called. It also

does not have a way to directly set QML import path (but thanfully 
respects the corresponding environmental variables) & there are also 
some issues with

argument parsing to an application run with sailfish-qml.

>   (asking as modrana currently seems to be calling a binary, so had to go through sdk? If not qmlscene what is proper way to submit pure qml apps?)

I basically get fed up with all the hack I had in place due to using 
sailfish-qml and decided writing a simple launcher in C++/Qt5 was 
actually less tedious. :)

Some of the backstory for the decision can be read here:



To summarize:

- it is simpler for users to run "modrana" from a terminal than typing 
"sailfish-qml harbour-modrana"

- you can easily support the usual options such as --help, --version a 
others without sailfish-qml getting in the way

- you can easily set all the QML and Python import paths without bending 
backwards like with sailfish-qml

- having a C++/Qt5 launcher opens the possibility to interact with Qt5 
C++ APIs & pure C/C++ APIs not available from QML or via Python and 
exposing them to the QML context as needed

- IIRC having a native launcher makes it possible to use the QML 
profiling and tracing functionality available in QtCreator

- a C++/Qt5 launcher is pretty much mandatory anyway for running modRana 
(or other Qt 5 + Python 3) applications from Flatpak or on Android

Also please note that the native launcher simply adds another way how to 
launch modRana, that is generally more convenient in specific scenarios. 
You can still run modRana via QML scene and even by running modrana.py 
and it should do the right thing. :)

As for using the Sailfish OS/Qt SDK - I did use it for the initial 
development of the launcher & bigger changes, but I generally simply 
build the launcher from the command line on desktop or on Mer OBS for 
Sailfish OS, so the SDK is not strictly needed (though the code 
completion is certainly useful, given my minimal knowledge of C++ :D).

In short I suggest looking into sailfish-qml or possibly feel free to 
repurpose the modRana launcher for your purposes. :) Also IIRC Poor Maps 
has (or at least used to have) a really minimal native launcher for use 
in Flatpaks.

> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org

More information about the Devel mailing list