summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/src/snippets/sensorgestures/sensorgestures.pro2
-rw-r--r--doc/src/snippets/sensors/sensors.pro2
-rw-r--r--examples/sensors/grue/console_app/console_app.pro1
-rw-r--r--examples/sensors/grue/import/import.pro2
-rw-r--r--examples/sensors/grue/lib/gruesensor.h12
-rw-r--r--examples/sensors/grue/lib/lib.pro2
-rw-r--r--examples/sensors/grue/plugin/main.cpp2
-rw-r--r--tests/auto/sensors2qmlapi/qdeclaccelerometer.h8
-rw-r--r--tests/auto/sensors2qmlapi/tst_sensors2qmlapi.cpp8
9 files changed, 24 insertions, 15 deletions
diff --git a/doc/src/snippets/sensorgestures/sensorgestures.pro b/doc/src/snippets/sensorgestures/sensorgestures.pro
index c34a0188..d692694a 100644
--- a/doc/src/snippets/sensorgestures/sensorgestures.pro
+++ b/doc/src/snippets/sensorgestures/sensorgestures.pro
@@ -5,5 +5,5 @@ SOURCES+=main.cpp\
creating.cpp\
plugin.cpp
HEADERS+=myplugin.h
-LIBS+=-rdynamic
+*g++*:LIBS+=-rdynamic
QT+=widgets
diff --git a/doc/src/snippets/sensors/sensors.pro b/doc/src/snippets/sensors/sensors.pro
index b34794e1..cf162e59 100644
--- a/doc/src/snippets/sensors/sensors.pro
+++ b/doc/src/snippets/sensors/sensors.pro
@@ -6,5 +6,5 @@ SOURCES+=main.cpp\
start.cpp\
plugin.cpp
HEADERS+=mybackend.h
-LIBS+=-rdynamic
+*g++*:LIBS+=-rdynamic
QT+=widgets
diff --git a/examples/sensors/grue/console_app/console_app.pro b/examples/sensors/grue/console_app/console_app.pro
index fefc0157..33d43176 100644
--- a/examples/sensors/grue/console_app/console_app.pro
+++ b/examples/sensors/grue/console_app/console_app.pro
@@ -1,5 +1,6 @@
TEMPLATE=app
TARGET=detect_grue
+CONFIG += console
QT=core sensors
SOURCES=main.cpp
diff --git a/examples/sensors/grue/import/import.pro b/examples/sensors/grue/import/import.pro
index f76b089d..0bb108f7 100644
--- a/examples/sensors/grue/import/import.pro
+++ b/examples/sensors/grue/import/import.pro
@@ -3,7 +3,7 @@ TARGETPATH = Grue
include(qsensorsimport.pri)
-QT = declarative sensors
+QT = core gui declarative sensors
INCLUDEPATH += $$PWD/../lib
LIBS += -L$$OUT_PWD/../lib -lgruesensor
diff --git a/examples/sensors/grue/lib/gruesensor.h b/examples/sensors/grue/lib/gruesensor.h
index 48df1fd8..1465aaaa 100644
--- a/examples/sensors/grue/lib/gruesensor.h
+++ b/examples/sensors/grue/lib/gruesensor.h
@@ -45,7 +45,13 @@
class GrueSensorReadingPrivate;
-class GrueSensorReading : public QSensorReading
+#if defined(QT_BUILD_GRUE_LIB)
+# define Q_GRUE_EXPORT Q_DECL_EXPORT
+#else
+# define Q_GRUE_EXPORT Q_DECL_IMPORT
+#endif
+
+class Q_GRUE_EXPORT GrueSensorReading : public QSensorReading
{
Q_OBJECT
Q_PROPERTY(qreal chanceOfBeingEaten READ chanceOfBeingEaten WRITE setChanceOfBeingEaten)
@@ -57,7 +63,7 @@ public:
// begin generated code
-class GrueFilter : public QSensorFilter
+class Q_GRUE_EXPORT GrueFilter : public QSensorFilter
{
public:
virtual bool filter(GrueSensorReading *reading) = 0;
@@ -65,7 +71,7 @@ private:
bool filter(QSensorReading *reading) { return filter(static_cast<GrueSensorReading*>(reading)); }
};
-class GrueSensor : public QSensor
+class Q_GRUE_EXPORT GrueSensor : public QSensor
{
Q_OBJECT
public:
diff --git a/examples/sensors/grue/lib/lib.pro b/examples/sensors/grue/lib/lib.pro
index 1cce4dae..dcfd6895 100644
--- a/examples/sensors/grue/lib/lib.pro
+++ b/examples/sensors/grue/lib/lib.pro
@@ -1,6 +1,8 @@
TEMPLATE = lib
TARGET = gruesensor
+DESTDIR = $$OUT_PWD
+DEFINES *= QT_BUILD_GRUE_LIB
QT = core sensors
HEADERS += gruesensor.h\
diff --git a/examples/sensors/grue/plugin/main.cpp b/examples/sensors/grue/plugin/main.cpp
index 50333f2d..74a8900d 100644
--- a/examples/sensors/grue/plugin/main.cpp
+++ b/examples/sensors/grue/plugin/main.cpp
@@ -77,7 +77,7 @@ public:
QStringList keys() const { return QStringList() << "grue";}
};
-Q_EXPORT_PLUGIN2(libsensors_grueplugin, GrueSensorPlugin);
+Q_EXPORT_PLUGIN2(libsensors_grueplugin, GrueSensorPlugin)
#include "main.moc"
diff --git a/tests/auto/sensors2qmlapi/qdeclaccelerometer.h b/tests/auto/sensors2qmlapi/qdeclaccelerometer.h
index 5d8da9fb..01b8ea68 100644
--- a/tests/auto/sensors2qmlapi/qdeclaccelerometer.h
+++ b/tests/auto/sensors2qmlapi/qdeclaccelerometer.h
@@ -65,13 +65,13 @@ public:
}
bool isActive() { return _active; }
- void test(float x, float y, float z)
+ void test(qreal x, qreal y, qreal z)
{
if (sensor()->filters().count() > 0){
QAccelerometerFilter* af = (QAccelerometerFilter*)sensor()->filters().at(0);
- reader.setX((qreal)x);
- reader.setY((qreal)y);
- reader.setZ((qreal)z);
+ reader.setX(x);
+ reader.setY(y);
+ reader.setZ(z);
af->filter(&reader);
}
}
diff --git a/tests/auto/sensors2qmlapi/tst_sensors2qmlapi.cpp b/tests/auto/sensors2qmlapi/tst_sensors2qmlapi.cpp
index 6c1e085b..2e438fd5 100644
--- a/tests/auto/sensors2qmlapi/tst_sensors2qmlapi.cpp
+++ b/tests/auto/sensors2qmlapi/tst_sensors2qmlapi.cpp
@@ -404,8 +404,8 @@ void tst_Sensors2QMLAPI::testTiltUnit()
_tilt->setProperty("accuracy", 0.0);
_tilt->setProperty("unit", QVariant(QSensor2Tilt::Radians));
accel->test(-3.59904, 5.52114, 7.07059);
- float xRotation = _tilt->property("xRotation").toFloat();
- float yRotation = _tilt->property("yRotation").toFloat();
+ qreal xRotation = _tilt->property("xRotation").toReal();
+ qreal yRotation = _tilt->property("yRotation").toReal();
xRotation += 0.159136;
yRotation -= 0.43440;
QVERIFY(xRotation < 0.0001);
@@ -414,8 +414,8 @@ void tst_Sensors2QMLAPI::testTiltUnit()
_tilt->setProperty("unit", QVariant(QSensor2Tilt::Degrees));
accel->test(-3.59904, 5.52114, 7.07059);
- xRotation = _tilt->property("xRotation").toFloat();
- yRotation = _tilt->property("yRotation").toFloat();
+ xRotation = _tilt->property("xRotation").toReal();
+ yRotation = _tilt->property("yRotation").toReal();
xRotation += 9.11778;
yRotation -= 24.8898;
QVERIFY(xRotation < 0.0001);