summaryrefslogblamecommitdiffstats
path: root/qt-ui/profile/divetextitem.h
blob: a6c0622f8997cb22a89729dd6c03c56d58dc1348 (plain) (tree)
1
2
3
4
5
6
7
8
9


                      

                                
                                               
                                                                


                                                               
                                                
                                          
                                       
                                           
                              
        
                          
                               
                                              
                             
                                  
                     
  
                        
#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;
	color_indice_t colorIndex;
	QBrush brush;
	double scale;
};

#endif // DIVETEXTITEM_H