PDA

View Full Version : How to use/configure QtSensors



Marina K.
30th June 2011, 12:11
Hi everyone,

i want to try how sensors work.
How can i include "QtSensors" module into a project?

I have installed the latest Qt SDK 1.1.
Why can't i simply write in ".pro" file

CONFIG += mobility
MOBILITY += sensors

and in ".h" file add
#include <QSensor> and then declare variable
QSensor* sensor; ????

This is really frustrating...


Thx!
Marina

high_flyer
30th June 2011, 16:03
Zdravo Marina,

have a look here:
http://doc.qt.nokia.com/qtmobility/installation.html
and look below under "Making the libraries available to applications"

Marina K.
2nd July 2011, 20:26
Zdravo high_flyer :):) hehe
Thx for the reply.

If anyone has the same problem, solution is to add "QTM_USE_NAMESPACE" below "#include" part :) in ".h" file

This is how ".pro" file looks like:

QT=core gui
CONFIG += mobility strict_flags
MOBILITY += sensors
INCLUDEPATH += ../../../src/sensors