[SailfishDevel] QAccelerometer availability ?

christopher.lamb at thurweb.ch christopher.lamb at thurweb.ch
Sun Jan 12 12:06:55 UTC 2014


Hi Franck

This blog post should go somewhere towards helping you.

http://flyingsheeponsailfish.blogspot.ch/2013/11/deploying-additional-packages-to.html

What is your target? The Emulator or a real device?

Either way, ssh into it, then run the following commands to see what  
is already installed:

export LANG=C
pkcon search name sensors

On my Jolla I get:

[nemo at localhost ~]$ export LANG=C
[nemo at localhost ~]$ pkcon search name sensors
Searching by name             [=========================]
Waiting in queue              [=========================]
Starting                      [=========================]
Refreshing software list      [=========================]
Querying                      [=========================]
Installed    
	qt5-qtdeclarative-import-sensors-5.1.0+git6-1.3.10.armv7hl	QtQml  
sensors import
Available    
	qt5-qtdeclarative-import-sensors-debuginfo-5.1.0+git6-1.3.10.armv7hl	Debug  
information for package qt5-qtdeclarative-import-sensors
Installed   	qt5-qtsensors-5.1.0+git6-1.3.10.armv7hl 	Qt Sensors module
Available   	qt5-qtsensors-5.1.0+git6-1.3.8.source   	Qt Sensors module
Available   	qt5-qtsensors-debuginfo-5.1.0+git6-1.3.10.armv7hl	Debug  
information for package qt5-qtsensors
Available   	qt5-qtsensors-debugsource-5.1.0+git6-1.3.10.armv7hl	Debug  
sources for package qt5-qtsensors
Available   	qt5-qtsensors-devel-5.1.0+git6-1.3.10.armv7hl	Qt sensors  
- development files
Available    
	qt5-qtsensors-plugin-generic-5.1.0+git6-1.3.10.armv7hl	Generic  
sensors plugin
Available    
	qt5-qtsensors-plugin-generic-debuginfo-5.1.0+git6-1.3.10.armv7hl	Debug  
information for package qt5-qtsensors-plugin-generic
Available    
	qt5-qtsensors-plugin-gestures-sensor-5.1.0+git6-1.3.10.armv7hl	Sensor  
gesture plugin
Available    
	qt5-qtsensors-plugin-gestures-sensor-debuginfo-5.1.0+git6-1.3.10.armv7hl	Debug information for package  
qt5-qtsensors-plugin-gestures-sensor
Available    
	qt5-qtsensors-plugin-gestures-shake-5.1.0+git6-1.3.10.armv7hl	Shake  
gesture plugin
Available    
	qt5-qtsensors-plugin-gestures-shake-debuginfo-5.1.0+git6-1.3.10.armv7hl	Debug  
information for package qt5-qtsensors-plugin-gestures-shake
Installed    
	qt5-qtsensors-plugin-sensorfw-5.1.0+git6-1.3.10.armv7hl	sensorfw  
sensors plugin
Available    
	qt5-qtsensors-plugin-sensorfw-debuginfo-5.1.0+git6-1.3.10.armv7hl	Debug  
information for package qt5-qtsensors-plugin-sensorfw

For qml you will need qt5-qtdeclarative-import-sensors and  
qt5-qtsensors. The blog post above should give you a number of ways to  
get these installed, including via the yaml file.


If these are missing on your target then (on your target):

pkcon install qt5-qtdeclarative-import-sensors

This should install both packages.

mfg

Chris



Zitat von "Franck Routier (perso)" <alci at mecadu.org>:

> Hi,
>
> I'm still stuck with this. Back to the basics...
>
> In my qml, I have added:
>
> import QtSensors 5.0 and used Accelerometer.
>
> Fine. But On deployment, I get an error: module "QtSensors" is not installed
>
> I think I have to edit something in my .pro file: I tried
> CONFIG += qt5-qtsensors
>
> but it didn't work.
>
> Maybe I should also make changes in the rpm yaml, although I think as it
> is available by default, I shouldn't.
>
> Could someone give me a pointer on "putting Qt / qml modules in my
> project classpath" ?
>
> Thanks in advance,
> Franck
>
> Le 11/01/2014 18:22, Mike Sheldon a écrit :
>> Hi Frank,
>>
>> On Sat, 2014-01-11 at 18:03 +0100, Franck Routier (perso) wrote:
>>> So: is QAccelerometer available in Sailfish SDK ?
>>> If not, is it planned ?
>>> Or is there another way to get this kind of features ?
>>
>>  They're part of the QtSensors module which is available in the
>> packages: "qt5-qtsensors" and "qt5-qtdeclarative-import-sensors" (for
>> QML support). They're both on the Harbour approved list, so you don't
>> need to worry about bundling them with your app or anything.
>>
>>  I'm currently using the QML Accelerometer element in a game, so I can
>> confirm it works correctly.
>>
>> Cheers,
>>  Mike.
>>
>> _______________________________________________
>> SailfishOS.org Devel mailing list
>>
>
> _______________________________________________
> SailfishOS.org Devel mailing list
>





More information about the Devel mailing list