summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divetextitem.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-01-14 15:23:57 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-16 10:12:29 +0700
commit408b7dd5e568519360701e01bc87888a5d8be931 (patch)
treecc73353ea73d49c4ae10d70265be391a51ea461f /qt-ui/profile/divetextitem.h
parentd47456b4e858fa75dadcff4a1c6525ad0137d965 (diff)
downloadsubsurface-408b7dd5e568519360701e01bc87888a5d8be931.tar.gz
Add a class based on QGraphicsSimpleTextItem that handles animations.
This commit adds a class based on QGraphicsSimpleTextItem that handls animations via animatedHide() animatedMoveTo() and a few other QPropertyes. This is to be used in conjunction with the DiveLineItem added in the past commit on the Coordinate Axis. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divetextitem.h')
-rw-r--r--qt-ui/profile/divetextitem.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/qt-ui/profile/divetextitem.h b/qt-ui/profile/divetextitem.h
new file mode 100644
index 000000000..b2e3fb61e
--- /dev/null
+++ b/qt-ui/profile/divetextitem.h
@@ -0,0 +1,22 @@
+#ifndef DIVETEXTITEM_H
+#define DIVETEXTITEM_H
+
+#include <QObject>
+#include <QGraphicsSimpleTextItem>
+
+/* A Line Item that has animated-properties. */
+class DiveTextItem :public QObject, public QGraphicsSimpleTextItem{
+ Q_OBJECT
+ Q_PROPERTY(QPointF pos READ pos WRITE setPos)
+ Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
+public:
+ DiveTextItem(QGraphicsItem* parent = 0);
+ virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
+ void setAlignment(int alignFlags);
+ void animatedHide();
+ void animateMoveTo(qreal x, qreal y);
+private:
+ int internalAlignFlags;
+};
+
+#endif