subsurface/qt-ui/profile/divetextitem.h
Tomaz Canabrava caba6500d6 Add the dive computer text.
Added the dive computer text on the bottom left side of the new Profile.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-21 09:38:46 -08:00

32 lines
818 B
C++

#ifndef DIVETEXTITEM_H
#define DIVETEXTITEM_H
#include <QObject>
#include <QGraphicsItemGroup>
#include "graphicsview-common.h"
#include <QBrush>
/* A Line Item that has animated-properties. */
class DiveTextItem :public QObject, public QGraphicsItemGroup{
Q_OBJECT
Q_PROPERTY(QPointF pos READ pos WRITE setPos)
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
public:
DiveTextItem(QGraphicsItem* parent = 0);
void setText(const QString& text);
void setAlignment(int alignFlags);
void setBrush(const QBrush& brush);
void animatedHide();
void animateMoveTo(qreal x, qreal y);
const QString& text();
private:
void updateText();
int internalAlignFlags;
QGraphicsPathItem *textBackgroundItem;
QGraphicsPathItem *textItem;
QString internalText;
color_indice_t colorIndex;
QBrush brush;
};
#endif