Using QtMobility on SailfishOS SDK

Jolla's SailfishOS SDK was released quite some time back for Linux, OSX and Windows. I had tried it once during that time but only compiled some sample apps until I found some time recently to port one of my N9/Harmattan apps to Sailfish/Nemo.

The problem

The app needed to use the device's GPS system to know its coordinates for which I used QtMobility's location API. However, when trying to compile, the SDK wasn't able to find the QGeoPositionInfoSource header and I found that it was really missing from the SDK's include dir. In fact, the whole QtMobility module was missing.

The solution

SailfishOS SDK doesn't contain QtMobility by default, you have to install it manually. Luckily the SailfishOS SDK control center makes it easy.

  1. Click on the SailfishOS button on the leftmost toolbar in Qt Creator
  2. Goto Targets and click 'manage' in SailfishOS-i486-x86 (it might be different for you)
  3. Scroll down to qt-mobility-devel and install it.

Presto! Now you can use QtMobility in your application 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s