Swiftray  1.0
TextShape Class Reference

#include <text-shape.h>

Inheritance diagram for TextShape:
PathShape Shape

Public Member Functions

 TextShape () noexcept
 
 TextShape (QString text, QFont font)
 
shared_ptr< Shapeclone () const override
 
const QFont & font () const
 
bool isEditing () const
 
float lineHeight () const
 
void makeCursorRect (int cursor)
 
void paint (QPainter *painter) const override
 
void setEditing (bool editing)
 
void setFont (const QFont &font)
 
void setLineHeight (float line_height)
 
void setText (QString text)
 
QString text ()
 
Shape::Type type () const override
 
- Public Member Functions inherited from PathShape
 PathShape () noexcept
 
 PathShape (QPainterPath path)
 
virtual ~PathShape ()
 
bool hitTest (QPointF global_coord, qreal tolerance) const override
 
bool hitTest (QRectF global_coord_rect) const override
 
bool isFilled () const
 
const QPainterPath & path () const
 
void setFilled (bool filled)
 
void setPath (const QPainterPath &path)
 
- Public Member Functions inherited from Shape
 Shape () noexcept
 
virtual ~Shape ()
 
void applyTransform (const QTransform &transform)
 
QRectF boundingRect () const
 
void flushCache ()
 
QTransform globalTransform () const
 
bool hasLayer () const
 
bool isLayerLocked () const
 
bool isParentSelected () const
 
Layerlayer () const
 
virtual operator QString ()
 
Shapeparent () const
 
QPointF pos () const
 
QPolygonF rotatedBBox () const
 
qreal rotation () const
 
bool selected () const
 
void setLayer (Layer *layer)
 
void setParent (Shape *parent)
 
void setRotation (qreal r)
 
void setSelected (bool selected)
 
void setTempTransform (const QTransform &transform)
 
void setTransform (const QTransform &transform)
 
const QTransform & tempTransform () const
 
const QTransform & transform () const
 
qreal x () const
 
qreal y () const
 

Friends

class DocumentSerializer
 

Additional Inherited Members

- Public Types inherited from PathShape
enum class  NodeType {
  CurveSymmetry , CurveSmooth , CurveCorner , CurveCtrlPrev ,
  CurveCtrlNext , LINE_TO , MOVE_TO
}
 
- Public Types inherited from Shape
enum class  Type {
  None , Path , Bitmap , Text ,
  Group
}
 
- Protected Attributes inherited from PathShape
QPainterPath path_
 
- Protected Attributes inherited from Shape
QRectF bbox_
 
QPolygonF rotated_bbox_
 
bool selected_
 
QTransform temp_transform_
 
QTransform transform_
 

Constructor & Destructor Documentation

◆ TextShape() [1/2]

TextShape::TextShape ( )
noexcept

◆ TextShape() [2/2]

TextShape::TextShape ( QString  text,
QFont  font 
)

Member Function Documentation

◆ clone()

shared_ptr< Shape > TextShape::clone ( ) const
overridevirtual

Reimplemented from PathShape.

◆ font()

const QFont & TextShape::font ( ) const

◆ isEditing()

bool TextShape::isEditing ( ) const

◆ lineHeight()

float TextShape::lineHeight ( ) const

◆ makeCursorRect()

void TextShape::makeCursorRect ( int  cursor)

◆ paint()

void TextShape::paint ( QPainter *  painter) const
overridevirtual

Reimplemented from PathShape.

◆ setEditing()

void TextShape::setEditing ( bool  editing)

◆ setFont()

void TextShape::setFont ( const QFont &  font)

◆ setLineHeight()

void TextShape::setLineHeight ( float  line_height)

◆ setText()

void TextShape::setText ( QString  text)

◆ text()

QString TextShape::text ( )

◆ type()

Shape::Type TextShape::type ( ) const
overridevirtual

Returns shape type in Shape::Type

Reimplemented from PathShape.

Friends And Related Function Documentation

◆ DocumentSerializer

friend class DocumentSerializer
friend

The documentation for this class was generated from the following files: