| 
									
										
										
										
											2014-01-14 15:23:57 -02:00
										 |  |  | #ifndef DIVETEXTITEM_H
 | 
					
						
							|  |  |  | #define DIVETEXTITEM_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QObject>
 | 
					
						
							| 
									
										
										
										
											2014-01-19 16:16:04 -02:00
										 |  |  | #include <QGraphicsItemGroup>
 | 
					
						
							|  |  |  | #include "graphicsview-common.h"
 | 
					
						
							|  |  |  | #include <QBrush>
 | 
					
						
							| 
									
										
										
										
											2014-01-14 15:23:57 -02:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* A Line Item that has animated-properties. */ | 
					
						
							| 
									
										
										
										
											2014-02-27 20:09:57 -08:00
										 |  |  | class DiveTextItem : public QObject, public QGraphicsItemGroup { | 
					
						
							| 
									
										
										
										
											2014-01-14 15:23:57 -02:00
										 |  |  | 	Q_OBJECT | 
					
						
							|  |  |  | 	Q_PROPERTY(QPointF pos READ pos WRITE setPos) | 
					
						
							|  |  |  | 	Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity) | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2014-02-27 20:09:57 -08:00
										 |  |  | 	DiveTextItem(QGraphicsItem *parent = 0); | 
					
						
							|  |  |  | 	void setText(const QString &text); | 
					
						
							| 
									
										
										
										
											2014-01-14 15:23:57 -02:00
										 |  |  | 	void setAlignment(int alignFlags); | 
					
						
							| 
									
										
										
										
											2014-02-15 07:03:41 -08:00
										 |  |  | 	void setScale(double newscale); | 
					
						
							| 
									
										
										
										
											2014-02-27 20:09:57 -08:00
										 |  |  | 	void setBrush(const QBrush &brush); | 
					
						
							|  |  |  | 	const QString &text(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-01-14 15:23:57 -02:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2014-01-19 16:16:04 -02:00
										 |  |  | 	void updateText(); | 
					
						
							| 
									
										
										
										
											2014-01-14 15:23:57 -02:00
										 |  |  | 	int internalAlignFlags; | 
					
						
							| 
									
										
										
										
											2014-01-19 16:16:04 -02:00
										 |  |  | 	QGraphicsPathItem *textBackgroundItem; | 
					
						
							|  |  |  | 	QGraphicsPathItem *textItem; | 
					
						
							| 
									
										
										
										
											2014-01-21 10:48:26 -02:00
										 |  |  | 	QString internalText; | 
					
						
							| 
									
										
										
										
											2014-01-19 16:16:04 -02:00
										 |  |  | 	color_indice_t colorIndex; | 
					
						
							|  |  |  | 	QBrush brush; | 
					
						
							| 
									
										
										
										
											2014-02-15 07:03:41 -08:00
										 |  |  | 	double scale; | 
					
						
							| 
									
										
										
										
											2014-01-14 15:23:57 -02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-11 19:14:46 +01:00
										 |  |  | #endif // DIVETEXTITEM_H
 |