1 #ifndef ORIENTATIONCONTROLLEDGRAPHICSPIXMAPOBJECT_H
2 #define ORIENTATIONCONTROLLEDGRAPHICSPIXMAPOBJECT_H
4 #include <QGraphicsPixmapItem>
5 #include <QRotationSensor>
11 class OrientationControlledGraphicsPixmapObject : public QObject, public QGraphicsPixmapItem
15 // explicit OrientationControlledGraphicsPixmapObject(QGraphicsItem *parent = 0);
16 explicit OrientationControlledGraphicsPixmapObject(QPixmap pixmap = 0, QGraphicsItem *parent = 0);
23 void readRotationSensor();
24 void setBoundaries(QRectF boundaryrect);
26 /*! sets what QGraphicsItems to treat as obstacles not to move on top of
27 @param key The key to be used with QGraphicsItem::data() to find the correct value to compare
28 @param values The values received from QGraphicsItem::data() to treat as obstacles
30 void setObstacles(int key, QList<QVariant> values);
35 QRotationSensor rotationSensor_;
40 QList<QVariant> obstacleValues_;
44 #endif // ORIENTATIONCONTROLLEDGRAPHICSPIXMAPOBJECT_H