mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 06:00:20 +00:00
d2c5770ae1
Also a bit of code cleanup. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
31 lines
783 B
C++
31 lines
783 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 setScale(double newscale);
|
|
void setBrush(const QBrush &brush);
|
|
const QString &text();
|
|
|
|
private:
|
|
void updateText();
|
|
int internalAlignFlags;
|
|
QGraphicsPathItem *textBackgroundItem;
|
|
QGraphicsPathItem *textItem;
|
|
QString internalText;
|
|
double scale;
|
|
};
|
|
|
|
#endif // DIVETEXTITEM_H
|