Added POI text field. Some tuning to detail screen item position.
[jspeed] / src / pointer.cpp
index 2431844..09bd089 100644 (file)
  *
  */
 
+#include <QtGui/QGraphicsPixmapItem>
 #include <QtCore/QDebug>
 #include <QtCore/QTimeLine>
-#include <QtGui/QGraphicsItemAnimation>
-#include <QtGui/QGraphicsPixmapItem>
 #include <math.h>
 #include "pointer.h"
 #include "reader.h"
@@ -32,6 +31,8 @@ namespace
     {
      {"xpos", true},
      {"ypos", true},
+     {"zpos", true},
+     {"visiblewhen", false},
      {"src", false},
      {"zeroangle", true},
      {"fullangle", true},
@@ -46,7 +47,7 @@ namespace
     int const ANIMATION_UPDATEINTERVAL = 20;
 }
 
-Pointer::Pointer(Reader* reader, bool animate): QObject(0), GraphicsElement(reader),
+Pointer::Pointer(Reader* reader, bool animate): GraphicsElement(reader),
 xRotationPoint_(0), yRotationPoint_(0), x_(0), y_(0), zeroAngle_(0),
 fullAngle_(180), zeroSpeed_(0), fullSpeed_(220), targetAngle_(0),
 startAngle_(0), angle_(-1), imageSet_(false), animate_(animate), timer_(0)
@@ -85,6 +86,12 @@ bool Pointer::setAttribute(QString const& name, QString const& value)
         case YPOS:
             y_ = intVal;
             break;
+        case ZPOS:
+            element_->setZValue(intVal);
+            break;
+        case VISIBLEWHEN:
+            setVisibleWhen(strToVisibleWhen(value));
+            break;
         case SRC:
             return loadImage(value);
             break;
@@ -207,3 +214,9 @@ bool Pointer::loadImage(QString const& name)
 
     return true;
 }
+
+QGraphicsItem* Pointer::getElement() const
+{
+    return element_;
+}
+