mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add a class based on QGraphicsSimpleTextItem that handles animations.
This commit adds a class based on QGraphicsSimpleTextItem that handls animations via animatedHide() animatedMoveTo() and a few other QPropertyes. This is to be used in conjunction with the DiveLineItem added in the past commit on the Coordinate Axis. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d47456b4e8
commit
408b7dd5e5
3 changed files with 80 additions and 2 deletions
22
qt-ui/profile/divetextitem.h
Normal file
22
qt-ui/profile/divetextitem.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#ifndef DIVETEXTITEM_H
|
||||
#define DIVETEXTITEM_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QGraphicsSimpleTextItem>
|
||||
|
||||
/* A Line Item that has animated-properties. */
|
||||
class DiveTextItem :public QObject, public QGraphicsSimpleTextItem{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QPointF pos READ pos WRITE setPos)
|
||||
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
|
||||
public:
|
||||
DiveTextItem(QGraphicsItem* parent = 0);
|
||||
virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
|
||||
void setAlignment(int alignFlags);
|
||||
void animatedHide();
|
||||
void animateMoveTo(qreal x, qreal y);
|
||||
private:
|
||||
int internalAlignFlags;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue