SymbolEditor  1.3.0
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
Symbol Class Reference

Defines the Symbol class encapsulating the QPainterPath with how it is drawn. More...

#include <Symbol.h>

Public Member Functions

 Symbol ()
 
 ~Symbol ()
 
QPainterPath path () const
 
bool filled () const
 
qreal lineWidth () const
 
Qt::PenCapStyle capStyle () const
 
Qt::PenJoinStyle joinStyle () const
 
void setPath (const QPainterPath &path)
 
void setFilled (bool filled)
 
void setLineWidth (qreal width)
 
void setCapStyle (Qt::PenCapStyle penCapStyle)
 
void setJoinStyle (Qt::PenJoinStyle penJoinStyle)
 

Private Attributes

QPainterPath m_path
 
bool m_filled
 
qreal m_lineWidth
 
Qt::PenCapStyle m_capStyle
 
Qt::PenJoinStyle m_joinStyle
 

Static Private Attributes

static const qint32 version = 100
 

Friends

QDataStream & operator<< (QDataStream &stream, const Symbol &symbol)
 
QDataStream & operator>> (QDataStream &stream, Symbol &symbol)
 

Detailed Description

Defines the Symbol class encapsulating the QPainterPath with how it is drawn.

The Symbol incorporates the QPainterPath object with additional information as to how it should be drawn. Originally the path was drawn filled, the implementation of this Symbol class allows a fill attribute and a pen width attribute for outline paths. In addition the line end style and line join style can be changed.

Definition at line 33 of file Symbol.h.

Constructor & Destructor Documentation

Symbol::Symbol ( )

Constructor

The Symbol is initialized with filling enabled and a default pen width of 0.01 with a Qt::SquareCap end and a Qt::MiterJoin join type. The pen width is scaled with the painter.

Definition at line 39 of file Symbol.cpp.

Symbol::~Symbol ( )

Destructor

Definition at line 51 of file Symbol.cpp.

Member Function Documentation

Qt::PenCapStyle Symbol::capStyle ( ) const

Get the pen cap style, see the QPen documentation for details on the styles.

Returns
a Qt::PenCapStyle value

Definition at line 94 of file Symbol.cpp.

Here is the caller graph for this function:

bool Symbol::filled ( ) const

Get the path filled status.

Returns
true if the path is to be drawn filled, false if unfilled

Definition at line 72 of file Symbol.cpp.

Here is the caller graph for this function:

Qt::PenJoinStyle Symbol::joinStyle ( ) const

Get the pen join style, see the QPen documentation for details on the styles.

Returns
a Qt::PenJoinStyle value

Definition at line 105 of file Symbol.cpp.

Here is the caller graph for this function:

qreal Symbol::lineWidth ( ) const

Get the outline path line width.

Returns
a qreal representing the line width, this is scaled with the painter

Definition at line 83 of file Symbol.cpp.

Here is the caller graph for this function:

QPainterPath Symbol::path ( ) const

Get the QPainterPath for the symbol. The path also incorporates the path fill mode.

Returns
a QPainterPath

Definition at line 61 of file Symbol.cpp.

Here is the caller graph for this function:

void Symbol::setCapStyle ( Qt::PenCapStyle  capStyle)

Set the pen cap style, see the QPen documentation for details on the styles.

Parameters
capStylea Qt::PenCapStyle value

Definition at line 149 of file Symbol.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Symbol::setFilled ( bool  filled)

Set the filled status of the path.

Parameters
filledtrue if the path is to be drawn filled, false if unfilled

Definition at line 127 of file Symbol.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Symbol::setJoinStyle ( Qt::PenJoinStyle  joinStyle)

Set the pen join style, see the QPen documentation for details on the styles.

Parameters
joinStylea Qt::PenJoinStyle value

Definition at line 160 of file Symbol.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Symbol::setLineWidth ( qreal  width)

Set the line width for the outline paths.

Parameters
widththe width of the pen

Definition at line 138 of file Symbol.cpp.

Here is the caller graph for this function:

void Symbol::setPath ( const QPainterPath &  path)

Set the QPainterPath for the symbol.

Parameters
patha const reference to a QPainterPath

Definition at line 116 of file Symbol.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

QDataStream& operator<< ( QDataStream &  stream,
const Symbol symbol 
)
friend

Stream out a Symbol.

Parameters
streama reference to the QDataStream to write to
symbola const reference to the Symbol to stream
Returns
a reference to the stream

Definition at line 174 of file Symbol.cpp.

QDataStream& operator>> ( QDataStream &  stream,
Symbol symbol 
)
friend

Stream in a Symbol.

Parameters
streama reference to the QDataStream to read from
symbola reference to the Symbol to stream
Returns
a reference to the stream

Definition at line 194 of file Symbol.cpp.

Member Data Documentation

Qt::PenCapStyle Symbol::m_capStyle
private

pen cap style, see the QPen documentation for details

Definition at line 60 of file Symbol.h.

bool Symbol::m_filled
private

true if the path is filled, false if an outline path

Definition at line 58 of file Symbol.h.

Qt::PenJoinStyle Symbol::m_joinStyle
private

pen join style, see the QPen documentation for details

Definition at line 61 of file Symbol.h.

qreal Symbol::m_lineWidth
private

width of the pen, this is scaled with the painter

Definition at line 59 of file Symbol.h.

QPainterPath Symbol::m_path
private

the symbols path, incorporates fill method if m_filled is true

Definition at line 57 of file Symbol.h.

const qint32 Symbol::version = 100
staticprivate

version of the stream object

Definition at line 55 of file Symbol.h.


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