Plot the Temperature Text.

I Moved the 'plot text' method of the Old Graphics to the new
layout - this one was mostly unchanged as it was already good
as is.

And used the TemperatureProfileItem to also display texts.
This was the first implementation of the new system that uses
*less* code than the original one, wich makes me happy.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-01-17 17:54:47 -02:00 committed by Dirk Hohndel
parent 4ff73cf537
commit 35979537d9
5 changed files with 96 additions and 21 deletions

View file

@ -3,7 +3,7 @@
#include <QObject>
#include <QGraphicsPolygonItem>
#include "graphicsview-common.h"
/* This is the Profile Item, it should be used for quite a lot of things
on the profile view. The usage should be pretty simple:
@ -18,6 +18,7 @@
This is a generically item and should be used as a base for others, I think...
*/
class DiveTextItem;
class DiveCartesianAxis;
class QAbstractTableModel;
@ -57,6 +58,8 @@ public:
DiveTemperatureItem();
virtual void modelDataChanged();
virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
private:
void createTextItem(int seconds, int mkelvin);
};
class DiveGasPressureItem : public AbstractProfilePolygonItem{
@ -67,4 +70,7 @@ public:
private:
QVector<QPolygonF> polygons;
};
QGraphicsItemGroup *plotText(text_render_options_t *tro,const QPointF& pos, const QString& text, QGraphicsItem *parent);
#endif