SymbolEditor
1.3.0
|
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) |
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.
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.
Qt::PenCapStyle Symbol::capStyle | ( | ) | const |
Get the pen cap style, see the QPen documentation for details on the styles.
Definition at line 94 of file Symbol.cpp.
bool Symbol::filled | ( | ) | const |
Get the path filled status.
true
if the path is to be drawn filled, false
if unfilled Definition at line 72 of file Symbol.cpp.
Qt::PenJoinStyle Symbol::joinStyle | ( | ) | const |
Get the pen join style, see the QPen documentation for details on the styles.
Definition at line 105 of file Symbol.cpp.
qreal Symbol::lineWidth | ( | ) | const |
Get the outline path line width.
Definition at line 83 of file Symbol.cpp.
QPainterPath Symbol::path | ( | ) | const |
Get the QPainterPath for the symbol. The path also incorporates the path fill mode.
Definition at line 61 of file Symbol.cpp.
void Symbol::setCapStyle | ( | Qt::PenCapStyle | capStyle | ) |
Set the pen cap style, see the QPen documentation for details on the styles.
capStyle | a Qt::PenCapStyle value |
Definition at line 149 of file Symbol.cpp.
void Symbol::setFilled | ( | bool | filled | ) |
Set the filled status of the path.
filled | true if the path is to be drawn filled, false if unfilled |
Definition at line 127 of file Symbol.cpp.
void Symbol::setJoinStyle | ( | Qt::PenJoinStyle | joinStyle | ) |
Set the pen join style, see the QPen documentation for details on the styles.
joinStyle | a Qt::PenJoinStyle value |
Definition at line 160 of file Symbol.cpp.
void Symbol::setLineWidth | ( | qreal | width | ) |
Set the line width for the outline paths.
width | the width of the pen |
Definition at line 138 of file Symbol.cpp.
void Symbol::setPath | ( | const QPainterPath & | path | ) |
Set the QPainterPath for the symbol.
path | a const reference to a QPainterPath |
Definition at line 116 of file Symbol.cpp.
|
friend |
Stream out a Symbol.
stream | a reference to the QDataStream to write to |
symbol | a const reference to the Symbol to stream |
Definition at line 174 of file Symbol.cpp.
|
friend |
Stream in a Symbol.
stream | a reference to the QDataStream to read from |
symbol | a reference to the Symbol to stream |
Definition at line 194 of file Symbol.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |