QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
QgsLabelAttributes Class Reference

A class to store attributes needed for label rendering. More...

#include <qgslabelattributes.h>

Public Types

enum  Units { MapUnits = 0, PointUnits }

Public Member Functions

 QgsLabelAttributes (bool def=true)
 Constructor.
 ~QgsLabelAttributes ()
void setText (const QString &text)
bool textIsSet () const
const QString text () const
void setFamily (const QString &family)
bool familyIsSet () const
const QString family () const
void setBold (bool enable)
bool boldIsSet () const
bool bold () const
void setItalic (bool enable)
bool italicIsSet () const
bool italic () const
void setUnderline (bool enable)
bool underlineIsSet () const
bool underline () const
void setStrikeOut (bool enable)
bool strikeOutIsSet () const
bool strikeOut () const
void setSize (double size, int type)
bool sizeIsSet () const
int sizeType () const
double size () const
void setColor (const QColor &color)
bool colorIsSet () const
const QColor & color () const
void setOffset (double x, double y, int type)
bool offsetIsSet () const
int offsetType () const
double xOffset () const
double yOffset () const
void setAngle (double angle)
bool angleIsSet () const
double angle () const
bool angleIsAuto () const
void setAutoAngle (bool state)
void setAlignment (int alignment)
bool alignmentIsSet () const
int alignment () const
bool bufferEnabled () const
void setBufferEnabled (bool useBufferFlag)
void setBufferSize (double size, int type)
bool bufferSizeIsSet () const
int bufferSizeType () const
double bufferSize () const
void setBufferColor (const QColor &color)
bool bufferColorIsSet () const
QColor bufferColor () const
void setBufferStyle (Qt::BrushStyle style)
bool bufferStyleIsSet () const
Qt::BrushStyle bufferStyle () const
void setBorderColor (const QColor &color)
bool borderColorIsSet () const
QColor borderColor () const
void setBorderWidth (int width)
bool borderWidthIsSet () const
int borderWidth () const
void setBorderStyle (Qt::PenStyle style)
bool borderStyleIsSet () const
Qt::PenStyle borderStyle () const
bool multilineEnabled () const
void setMultilineEnabled (bool useMultiline)
bool selectedOnly () const
void setSelectedOnly (bool selectedonly)

Static Public Member Functions

static QString unitsName (int units)
static int unitsCode (const QString &name)
static QString alignmentName (int alignment)
static int alignmentCode (const QString &name)

Protected Attributes

QString mText
bool mTextIsSet
QFont mFont
 Font (family, weight, italic, underline, strikeout)
bool mFamilyIsSet
bool mBoldIsSet
bool mItalicIsSet
bool mUnderlineIsSet
bool mStrikeOutIsSet
int mSizeType
 Font size, size type.
double mSize
bool mSizeIsSet
QColor mColor
 Color.
bool mColorIsSet
int mOffsetType
 Offset.
double mXOffset
double mYOffset
bool mOffsetIsSet
double mAngle
 Angle (degrees)
bool mAngleIsSet
bool mAngleIsAuto
int mAlignment
 Alignment.
bool mAlignmentIsSet
bool mBufferEnabledFlag
 Buffer enablement.
int mBufferSizeType
 Buffer size, size type.
double mBufferSize
bool mBufferSizeIsSet
QBrush mBufferBrush
 Buffer brush (color, style)
bool mBufferColorIsSet
bool mBufferStyleIsSet
QPen mBorderPen
 Border pen (color, width, style)
bool mBorderColorIsSet
bool mBorderWidthIsSet
bool mBorderStyleIsSet
bool mMultilineEnabledFlag
 Multiline enablement.
bool mSelectedOnly
 Label only selected.

Detailed Description

A class to store attributes needed for label rendering.

Label attributes: border (color, width, style) / / text bounding box / / +--------—/–+ buffer (color, pattern) | / | / | +-—+ |/ –+ | |Text| / |— text size | +-—+ /| –+ | | +-----------—+ | | | | >|-—|<— buffer width | >|<— border width

Text:

Position:

Buffer:

Border:

Each attribute is either set or unset.

Member Enumeration Documentation

Enumerator:
MapUnits 
PointUnits 

Constructor & Destructor Documentation

QgsLabelAttributes::QgsLabelAttributes ( bool  def = true)

Constructor.

Parameters
defif true, defaults are set, if false all all attributes are unset
QgsLabelAttributes::~QgsLabelAttributes ( )

Member Function Documentation

int QgsLabelAttributes::alignment ( void  ) const
int QgsLabelAttributes::alignmentCode ( const QString &  name)
static
bool QgsLabelAttributes::alignmentIsSet ( void  ) const
QString QgsLabelAttributes::alignmentName ( int  alignment)
static
double QgsLabelAttributes::angle ( void  ) const
bool QgsLabelAttributes::angleIsAuto ( ) const
bool QgsLabelAttributes::angleIsSet ( void  ) const
bool QgsLabelAttributes::bold ( void  ) const
bool QgsLabelAttributes::boldIsSet ( void  ) const
QColor QgsLabelAttributes::borderColor ( void  ) const
bool QgsLabelAttributes::borderColorIsSet ( void  ) const
Qt::PenStyle QgsLabelAttributes::borderStyle ( void  ) const
bool QgsLabelAttributes::borderStyleIsSet ( void  ) const
int QgsLabelAttributes::borderWidth ( void  ) const
bool QgsLabelAttributes::borderWidthIsSet ( void  ) const
QColor QgsLabelAttributes::bufferColor ( void  ) const
bool QgsLabelAttributes::bufferColorIsSet ( void  ) const
bool QgsLabelAttributes::bufferEnabled ( ) const
double QgsLabelAttributes::bufferSize ( void  ) const
bool QgsLabelAttributes::bufferSizeIsSet ( void  ) const
int QgsLabelAttributes::bufferSizeType ( void  ) const
Qt::BrushStyle QgsLabelAttributes::bufferStyle ( void  ) const
bool QgsLabelAttributes::bufferStyleIsSet ( void  ) const
const QColor & QgsLabelAttributes::color ( void  ) const
bool QgsLabelAttributes::colorIsSet ( void  ) const
const QString QgsLabelAttributes::family ( void  ) const
bool QgsLabelAttributes::familyIsSet ( void  ) const
bool QgsLabelAttributes::italic ( void  ) const
bool QgsLabelAttributes::italicIsSet ( void  ) const
bool QgsLabelAttributes::multilineEnabled ( ) const
bool QgsLabelAttributes::offsetIsSet ( void  ) const
int QgsLabelAttributes::offsetType ( void  ) const
bool QgsLabelAttributes::selectedOnly ( ) const
void QgsLabelAttributes::setAlignment ( int  alignment)
void QgsLabelAttributes::setAngle ( double  angle)
void QgsLabelAttributes::setAutoAngle ( bool  state)
void QgsLabelAttributes::setBold ( bool  enable)
void QgsLabelAttributes::setBorderColor ( const QColor &  color)
void QgsLabelAttributes::setBorderStyle ( Qt::PenStyle  style)
void QgsLabelAttributes::setBorderWidth ( int  width)
void QgsLabelAttributes::setBufferColor ( const QColor &  color)
void QgsLabelAttributes::setBufferEnabled ( bool  useBufferFlag)
void QgsLabelAttributes::setBufferSize ( double  size,
int  type 
)
void QgsLabelAttributes::setBufferStyle ( Qt::BrushStyle  style)
void QgsLabelAttributes::setColor ( const QColor &  color)
void QgsLabelAttributes::setFamily ( const QString &  family)
void QgsLabelAttributes::setItalic ( bool  enable)
void QgsLabelAttributes::setMultilineEnabled ( bool  useMultiline)
void QgsLabelAttributes::setOffset ( double  x,
double  y,
int  type 
)
void QgsLabelAttributes::setSelectedOnly ( bool  selectedonly)
void QgsLabelAttributes::setSize ( double  size,
int  type 
)
void QgsLabelAttributes::setStrikeOut ( bool  enable)
void QgsLabelAttributes::setText ( const QString &  text)
void QgsLabelAttributes::setUnderline ( bool  enable)
double QgsLabelAttributes::size ( void  ) const
bool QgsLabelAttributes::sizeIsSet ( void  ) const
int QgsLabelAttributes::sizeType ( void  ) const
bool QgsLabelAttributes::strikeOut ( void  ) const
bool QgsLabelAttributes::strikeOutIsSet ( void  ) const
const QString QgsLabelAttributes::text ( void  ) const
bool QgsLabelAttributes::textIsSet ( void  ) const
bool QgsLabelAttributes::underline ( void  ) const
bool QgsLabelAttributes::underlineIsSet ( void  ) const
int QgsLabelAttributes::unitsCode ( const QString &  name)
static
QString QgsLabelAttributes::unitsName ( int  units)
static
double QgsLabelAttributes::xOffset ( void  ) const
double QgsLabelAttributes::yOffset ( void  ) const

Member Data Documentation

int QgsLabelAttributes::mAlignment
protected

Alignment.

bool QgsLabelAttributes::mAlignmentIsSet
protected
double QgsLabelAttributes::mAngle
protected

Angle (degrees)

bool QgsLabelAttributes::mAngleIsAuto
protected
bool QgsLabelAttributes::mAngleIsSet
protected
bool QgsLabelAttributes::mBoldIsSet
protected
bool QgsLabelAttributes::mBorderColorIsSet
protected
QPen QgsLabelAttributes::mBorderPen
protected

Border pen (color, width, style)

bool QgsLabelAttributes::mBorderStyleIsSet
protected
bool QgsLabelAttributes::mBorderWidthIsSet
protected
QBrush QgsLabelAttributes::mBufferBrush
protected

Buffer brush (color, style)

bool QgsLabelAttributes::mBufferColorIsSet
protected
bool QgsLabelAttributes::mBufferEnabledFlag
protected

Buffer enablement.

double QgsLabelAttributes::mBufferSize
protected
bool QgsLabelAttributes::mBufferSizeIsSet
protected
int QgsLabelAttributes::mBufferSizeType
protected

Buffer size, size type.

bool QgsLabelAttributes::mBufferStyleIsSet
protected
QColor QgsLabelAttributes::mColor
protected

Color.

bool QgsLabelAttributes::mColorIsSet
protected
bool QgsLabelAttributes::mFamilyIsSet
protected
QFont QgsLabelAttributes::mFont
protected

Font (family, weight, italic, underline, strikeout)

bool QgsLabelAttributes::mItalicIsSet
protected
bool QgsLabelAttributes::mMultilineEnabledFlag
protected

Multiline enablement.

bool QgsLabelAttributes::mOffsetIsSet
protected
int QgsLabelAttributes::mOffsetType
protected

Offset.

bool QgsLabelAttributes::mSelectedOnly
protected

Label only selected.

double QgsLabelAttributes::mSize
protected
bool QgsLabelAttributes::mSizeIsSet
protected
int QgsLabelAttributes::mSizeType
protected

Font size, size type.

bool QgsLabelAttributes::mStrikeOutIsSet
protected
QString QgsLabelAttributes::mText
protected
bool QgsLabelAttributes::mTextIsSet
protected
bool QgsLabelAttributes::mUnderlineIsSet
protected
double QgsLabelAttributes::mXOffset
protected
double QgsLabelAttributes::mYOffset
protected

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