orientationfilter.h 534 B

1234567891011121314151617181920212223242526
  1. #ifndef ORIENTATIONFILTER_H
  2. #define ORIENTATIONFILTER_H
  3. #include <QOrientationFilter>
  4. #include <QtCore/QDebug>
  5. QTM_USE_NAMESPACE
  6. class OrientationFilter : public QObject, public QOrientationFilter
  7. {
  8. Q_OBJECT
  9. public:
  10. bool filter(QOrientationReading *reading) {
  11. emit orientationChanged(reading->orientation());
  12. // don't store the reading in the sensor
  13. return false;
  14. }
  15. signals:
  16. void orientationChanged(const QVariant &orientation);
  17. };
  18. #endif // ORIENTATIONFILTER_H