We have moved to a new Sailfish OS Forum. Please start new discussions there.

# Develop pure Qt/Qml App [answered]

Hi all, I'm with Sailfish since the beginning and I'm a software developer. I'd like to port to sailfish some Qml app but the SDK doesn't allow to use all standard Qt libs. It would be great to be able to port a working Qt application to Sailfish by simply compiling it with SDK. The same thing can be achieved building an Android Qt app.

What's the main issue? Why doesn't Jolla allow us to freely use Qt? It's a big limitation in my opinion.

Luca

edit retag reopen delete

### The question has been closed for the following reason "the question is answered, an answer was accepted"by molan close date 2019-11-01 16:53:21.397190

There have been a few apps that were buikt using only standard Qt/Qml Apis that run on SFOS, one of them is the telegram desktop app. Due to different screen resolution usability is limited, rhough. Jowever it's a proof that you can run those apps. I would try to identify the apis / libs that stop the SFOS Sdk feom building, You may add them manually. However if you plan to distribute your app Harbour ragulations are rather strict on those libs, OpenRepos may be an alternative. However due ro differenr UI concepts I guess there will be some effort to integrate your app into this eco system

( 2019-10-25 13:36:47 +0300 )edit

Sort by » oldest newest most voted

You might want to check the Universal Components project:

https://github.com/M4rtinK/universal-components/

It's an abstraction library that makes it possible to write single QML UI codebase and have it use the appropriate Qq Quick component set on the given platform on runtime.

Basically you do something like this:

import UC 1.0

Button {
text : "Hello World!"
}


And if you run the application on Sailfish OS the Silica Button element will be used. When you run it on desktop, the Qt Quick Controls 2 Button will be used. Same thing for other supported elements.

At the moment two backends are supported - Silica (Sailfish OS only) and Qt Quick Controls 2 (desktop, Android, likely others). Support for other component sets can be added if there is demand. :)

BTW, the Universal Components project is not just some proof of concept - I wrote this to make modRana (a navigation app) and Tsubame (a Twitter client) multi platform with a single code base. Both applications are pretty complex and have been using Universal Components to run on Sailfish OS & desktop Linux for years. :)

I guess checking their source code could provide you with good pointers how to integrate Universal Components with a non trivial application. :)

more

Thanks, I'll give a try.

( 2019-10-25 21:58:39 +0300 )edit

First of all, Sailfish uses a pretty different UI than other operating systems. For example the UI is usually split into pages, that can be advanced through like a stack. The UI is also translucent for the most part, which means some care has to be taken, that colours are readable.

Apart from that, Sailfish also ships a bit of an older Qt version, as the development team is quite small, they are using private APIs for some parts of their custom UI implementation, which makes porting harder and there were some licensing issues until recently, which made upgrading to a newer version harder (but they are mostly resolved now and a major Qt upgrade is in the pipeline).

Because of that, some Qt APIs weren't quite stable yet, some of them arent declared stable even now. Jolla doesn't want applications to use unstable APIs, because then they wouldn't be able to upgradeQt without potentially breaking a lot of applications. This isn't an issue on Android, as you generally bundle Qt with the app.

So maybe you can elaborate on the APIs, that you think are missing or what your specific issues are. Maybe adding your application to OpenRepos instead of harbour/the Jolla store would be an option? Maybe you can bundle the libraries you need with your application (like on Android)? You will probably still need to have separate QML files for Sailfish, but the rest of the application could maybe be shared.

more

Qt is not only kept back because of the size of the team, but rather for licensing issues.

( 2019-10-25 20:15:54 +0300 )edit

I mentioned that, didn't I? And as far as I know, those issues are now resolved, although the Jolla guys didn't go into much detail, how this works now, iirc.

( 2019-10-25 20:27:41 +0300 )edit

In my opinion Jolla should count on Qt developers to increase apps in store. To port Qt app to Android is as easy as rebuilding an application. It should be the same here. No matter about native behaviour of app on sailfish... for now.

( 2019-10-25 21:54:51 +0300 )edit

PureMaps is cross platform (qml/python). You might like to see (github) how he does the crossplatform qml part. I saw that he overloads controls, presumably for cross-platform reasons. Author is active on http://talk.maemo.org/showthread.php?t=100442 if you have questions.

more

If you have libraries that are missing from harbour you may also want to vote here: https://together.jolla.com/question/213847/status-of-allowed-libraries-in-harbour/

more