diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-11-24 08:46:23 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-25 08:24:29 +0100 |
commit | acbe469322d0ab4aac863192ca5bf6fe1feedaed (patch) | |
tree | 99fecca57b0781744aa2ec93b03240a9b7b91b84 /examples/sensors/grue | |
parent | f3a86a85b9a4f6d0f22364dcb66e2a8b9f21a9be (diff) | |
download | qtsensors-acbe469322d0ab4aac863192ca5bf6fe1feedaed.tar.gz |
QtSensors: Fix compilation of examples/warnings on Windows.
- Fix double->float truncation in tests
- Use -rdynamic for g++ only
- Introduce EXPORT macro in grue library for Windows to work
- Add DESTDIR for the grue lib (to prevent it from ending up
in the debug/release subfolders, respectively
Change-Id: I3b902b501483c92639c0a6252240db4ed8a4a00d
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lincoln Ramsay <lincoln.ramsay@nokia.com>
Diffstat (limited to 'examples/sensors/grue')
-rw-r--r-- | examples/sensors/grue/console_app/console_app.pro | 1 | ||||
-rw-r--r-- | examples/sensors/grue/import/import.pro | 2 | ||||
-rw-r--r-- | examples/sensors/grue/lib/gruesensor.h | 12 | ||||
-rw-r--r-- | examples/sensors/grue/lib/lib.pro | 2 | ||||
-rw-r--r-- | examples/sensors/grue/plugin/main.cpp | 2 |
5 files changed, 14 insertions, 5 deletions
diff --git a/examples/sensors/grue/console_app/console_app.pro b/examples/sensors/grue/console_app/console_app.pro index fefc015..33d4317 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 f76b089..0bb108f 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 48df1fd..1465aaa 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 1cce4da..dcfd689 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 50333f2..74a8900 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" |