Re: [SailfishDevel] QAccelerometer availability ?

2014-01-13 Thread Franck Routier (perso)
Le 13/01/2014 18:45, Lorn Potter a écrit :

> 
> You could have also used QSensorGestures :)
> I have not really had time to test and make sure they all work correctly on 
> sailfish, so your milage may vary.
> 
> 
Good to know, thanks. I'll probally try it and compare with my current
implementation.

Found docs for QML here:
http://qt-project.org/doc/qt-5.1/qtsensors/qmlsensorgestures.html

Best regards,

Franck

___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] QAccelerometer availability ?

2014-01-13 Thread Lorn Potter

On 13/01/2014, at 6:41 PM, Franck Routier (perso)  wrote:

> Thanks all for your help.
> 
> I ended up with this QML and thought I might share with the list:
> 
> - added qt5-qtdeclarative-import-sensors in Requires (.yaml)
> - created a component that checks if the device is shaked:
> 
> ShakeSensor.qml
> 
> import QtQuick 2.0
> import QtSensors 5.1
> 
> Accelerometer {
> 
>signal shaked
>property real sensitivity: 30
>property real module: 0
> 
>active: true
>dataRate: 20
> 
>onReadingChanged: {
>var rx = reading.x;
>var ry = reading.y;
>var rz = reading.z;
>var cmodule = Math.sqrt(rx * rx + ry * ry + rz * rz);
>var cshake = Math.sqrt(Math.pow(module,2)+Math.pow(cmodule,2));
> 
>if( cshake >= sensitivity ) {
>shaked();
>}
> 
>module = cmodule;
>}
> }
> 
> 
> This code is strongly indebted to QShake by Sebastiano Galazzo
>  for the way to find if device was shaked
> out of accelerometer readings. Thanks to him.

You could have also used QSensorGestures :)
I have not really had time to test and make sure they all work correctly on 
sailfish, so your milage may vary.


> 
> Check the result in my MkPokerPlanning app ! :-)
> 
> Best regards,
> Franck
> 
> Le 12/01/2014 17:00, Mike Sheldon a écrit :
>> On Sun, 2014-01-12 at 16:42 +0100, Franck Routier (perso) wrote:
>>> But... I get this:
>>> 
>>> SensorManagerInterface::interface:78 - Requested sensor id '
>>> "accelerometersensor" ' interface not granted
>>> 
>>> Any idea where this comes from ?
>> 
>> The emulator doesn't simulate accelerometer sensors, for this sort of
>> thing your only option is to test on device.
>> 
>> Cheers, 
>> Mike.
>> 
>> ___
>> SailfishOS.org Devel mailing list
>> 
> 
> ___
> SailfishOS.org Devel mailing list

Lorn Potter
QtSensors/ Connectivity
llornkcor technologies / Jolla Mobile

___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] QAccelerometer availability ?

2014-01-13 Thread Franck Routier (perso)
Thanks all for your help.

I ended up with this QML and thought I might share with the list:

- added qt5-qtdeclarative-import-sensors in Requires (.yaml)
- created a component that checks if the device is shaked:

ShakeSensor.qml

import QtQuick 2.0
import QtSensors 5.1

Accelerometer {

signal shaked
property real sensitivity: 30
property real module: 0

active: true
dataRate: 20

onReadingChanged: {
var rx = reading.x;
var ry = reading.y;
var rz = reading.z;
var cmodule = Math.sqrt(rx * rx + ry * ry + rz * rz);
var cshake = Math.sqrt(Math.pow(module,2)+Math.pow(cmodule,2));

if( cshake >= sensitivity ) {
shaked();
}

module = cmodule;
}
}


This code is strongly indebted to QShake by Sebastiano Galazzo
 for the way to find if device was shaked
out of accelerometer readings. Thanks to him.

Check the result in my MkPokerPlanning app ! :-)

Best regards,
Franck

Le 12/01/2014 17:00, Mike Sheldon a écrit :
> On Sun, 2014-01-12 at 16:42 +0100, Franck Routier (perso) wrote:
>> But... I get this:
>>
>> SensorManagerInterface::interface:78 - Requested sensor id '
>> "accelerometersensor" ' interface not granted
>>
>> Any idea where this comes from ?
> 
> The emulator doesn't simulate accelerometer sensors, for this sort of
> thing your only option is to test on device.
> 
> Cheers, 
> Mike.
> 
> ___
> SailfishOS.org Devel mailing list
> 

___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] QAccelerometer availability ?

2014-01-12 Thread Mike Sheldon
On Sun, 2014-01-12 at 16:42 +0100, Franck Routier (perso) wrote:
> But... I get this:
> 
> SensorManagerInterface::interface:78 - Requested sensor id '
> "accelerometersensor" ' interface not granted
> 
> Any idea where this comes from ?

The emulator doesn't simulate accelerometer sensors, for this sort of
thing your only option is to test on device.

Cheers, 
Mike.

___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] QAccelerometer availability ?

2014-01-12 Thread Mike Sheldon
On Sun, 2014-01-12 at 11:49 +0100, Franck Routier (perso) wrote:
> 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.

If you're using it from QML you'll need to depend on
qt5-qtdeclarative-import-sensors (I'm not sure if it's installed by
default, but your error would suggest probably not).

Cheers, 
Mike.


___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] QAccelerometer availability ?

2014-01-12 Thread Franck Routier (perso)
This blog helps a lot indeed, thanks for the link !

Now I have qt5-qtdeclarative-import-sensors automatically installed by
the rpm, and got rid of the "not installed" error.

But... I get this:

SensorManagerInterface::interface:78 - Requested sensor id '
"accelerometersensor" ' interface not granted

Any idea where this comes from ?

BR

Le 12/01/2014 13:06, christopher.l...@thurweb.ch a écrit :
> 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@localhost ~]$ export LANG=C
> [nemo@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.armv7hlQtQml
> 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.armv7hlQt
> sensors - development files
> Available  
> qt5-qtsensors-plugin-generic-5.1.0+git6-1.3.10.armv7hlGeneric
> 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.armv7hlsensorfw
> 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)" :
> 
>> 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
>>
> 
> 
> 

___
SailfishOS.org Devel mailing l

Re: [SailfishDevel] QAccelerometer availability ?

2014-01-12 Thread christopher . lamb

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@localhost ~]$ export LANG=C
[nemo@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)" :


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





___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] QAccelerometer availability ?

2014-01-12 Thread Franck Routier (perso)
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


Re: [SailfishDevel] QAccelerometer availability ?

2014-01-12 Thread Franck Routier (perso)
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thanks Mike.

now that I know it will work, I'll dig deeper !

BR
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
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS0l29AAoJEGEvoAir78RodbcIAJ+DGhflqLUFIYwGBzoOSnXt
dO5uLcpiO00kstF1zG9FbwFX9LdpUrZiD92QI9JvvdXrsFn3y4Ko6tvNN7i310zc
3sZJZ5hBFdEtW5uxdd+j/kt1yaSVy82D2lDEbuWBOEdlsPc5pYeG4FHB8LPEoL4K
edoYS+FqRm2TF0ieZR7ciOao3W8hFUt2PUxuPIKxpEsY1kJ8woTid+lRkrh24OzJ
4lI0qqOhlaw5UdNcss1JpSIAeYr/msuJI3+UmaIV4LarLFTz7uD2Z0HECOWmRcoz
zHa3x/UPYHbILWjE26VnDMLHGVQnMhA2pUrZIcBNodDHaaoZP0v4aiO/ka7At+I=
=W//D
-END PGP SIGNATURE-
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] QAccelerometer availability ?

2014-01-11 Thread Mike Sheldon
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


[SailfishDevel] QAccelerometer availability ?

2014-01-11 Thread Franck Routier (perso)
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I would like to use QAccelerometer in my app, but it does not seem to
be available...

Given that I am still in the early stage of learning Qt/qml/C++ (!), I
might just be wrong :-)

So: is QAccelerometer available in Sailfish SDK ?
If not, is it planned ?
Or is there another way to get this kind of features ?

Thanks,

BR
Franck
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS0XlfAAoJEGEvoAir78RoC2IH/1ArBZu4IkXV14zQv1d+gBsw
vkLf40Q83mzDJ/d8OmCThL2aPQA/1Xl2w9CDybpGd73SsS4+lKiE2dUDgIO/UnoT
ZEqlwttaNpLJy6a2CYXlyyzOvcrLhnecPTVXA8oHG969IrarPXdd7PvkQqVVjnLn
qyEEWYdNFQ6RHVc3CZq63AG9CiQPOlNT2Sd1fc6U611iD9bLaqVQPrw8CJphDGWI
AYLF1CqK/fFw2XgtmK9WyzM2FluxDFdp8pL40As2OPRurnVAGCs+F1rpTCcHSHvr
IlQ/o3j8tQlyrblBd/IqOYv/ftRNUZPlK9IMMzpvngsywqf/zibELVNkyVqzZGA=
=amdJ
-END PGP SIGNATURE-
___
SailfishOS.org Devel mailing list