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

Static Public Member Functions

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

Protected Attributes

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

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.

Definition at line 76 of file qgslabelattributes.h.

Member Enumeration Documentation

§ Units

Enumerator
MapUnits 
PointUnits 

Definition at line 85 of file qgslabelattributes.h.

Constructor & Destructor Documentation

§ QgsLabelAttributes()

QgsLabelAttributes::QgsLabelAttributes ( bool  def = true)

Constructor.

Parameters
defif true, defaults are set, if false all all attributes are unset

Definition at line 27 of file qgslabelattributes.cpp.

Member Function Documentation

§ alignment()

int QgsLabelAttributes::alignment ( ) const

Definition at line 175 of file qgslabelattributes.cpp.

§ alignmentCode()

int QgsLabelAttributes::alignmentCode ( const QString name)
static

Definition at line 477 of file qgslabelattributes.cpp.

§ alignmentIsSet()

bool QgsLabelAttributes::alignmentIsSet ( ) const

Definition at line 170 of file qgslabelattributes.cpp.

§ alignmentName()

QString QgsLabelAttributes::alignmentName ( int  alignment)
static

Definition at line 461 of file qgslabelattributes.cpp.

§ angle()

double QgsLabelAttributes::angle ( ) const

Definition at line 148 of file qgslabelattributes.cpp.

§ angleIsAuto()

bool QgsLabelAttributes::angleIsAuto ( ) const

Definition at line 153 of file qgslabelattributes.cpp.

§ angleIsSet()

bool QgsLabelAttributes::angleIsSet ( ) const

Definition at line 143 of file qgslabelattributes.cpp.

§ bold()

bool QgsLabelAttributes::bold ( ) const

Definition at line 209 of file qgslabelattributes.cpp.

§ boldIsSet()

bool QgsLabelAttributes::boldIsSet ( ) const

Definition at line 204 of file qgslabelattributes.cpp.

§ borderColor()

QColor QgsLabelAttributes::borderColor ( ) const

Definition at line 381 of file qgslabelattributes.cpp.

§ borderColorIsSet()

bool QgsLabelAttributes::borderColorIsSet ( ) const

Definition at line 376 of file qgslabelattributes.cpp.

§ borderStyle()

Qt::PenStyle QgsLabelAttributes::borderStyle ( ) const

Definition at line 414 of file qgslabelattributes.cpp.

§ borderStyleIsSet()

bool QgsLabelAttributes::borderStyleIsSet ( ) const

Definition at line 409 of file qgslabelattributes.cpp.

§ borderWidth()

int QgsLabelAttributes::borderWidth ( ) const

Definition at line 397 of file qgslabelattributes.cpp.

§ borderWidthIsSet()

bool QgsLabelAttributes::borderWidthIsSet ( ) const

Definition at line 392 of file qgslabelattributes.cpp.

§ bufferColor()

QColor QgsLabelAttributes::bufferColor ( ) const

Definition at line 347 of file qgslabelattributes.cpp.

§ bufferColorIsSet()

bool QgsLabelAttributes::bufferColorIsSet ( ) const

Definition at line 342 of file qgslabelattributes.cpp.

§ bufferEnabled()

bool QgsLabelAttributes::bufferEnabled ( ) const

Definition at line 305 of file qgslabelattributes.cpp.

§ bufferSize()

double QgsLabelAttributes::bufferSize ( ) const

Definition at line 330 of file qgslabelattributes.cpp.

§ bufferSizeIsSet()

bool QgsLabelAttributes::bufferSizeIsSet ( ) const

Definition at line 320 of file qgslabelattributes.cpp.

§ bufferSizeType()

int QgsLabelAttributes::bufferSizeType ( ) const

Definition at line 325 of file qgslabelattributes.cpp.

§ bufferStyle()

Qt::BrushStyle QgsLabelAttributes::bufferStyle ( ) const

Definition at line 364 of file qgslabelattributes.cpp.

§ bufferStyleIsSet()

bool QgsLabelAttributes::bufferStyleIsSet ( ) const

Definition at line 359 of file qgslabelattributes.cpp.

§ color()

const QColor & QgsLabelAttributes::color ( ) const

Definition at line 299 of file qgslabelattributes.cpp.

§ colorIsSet()

bool QgsLabelAttributes::colorIsSet ( ) const

Definition at line 294 of file qgslabelattributes.cpp.

§ family()

const QString QgsLabelAttributes::family ( ) const

Definition at line 192 of file qgslabelattributes.cpp.

§ familyIsSet()

bool QgsLabelAttributes::familyIsSet ( ) const

Definition at line 187 of file qgslabelattributes.cpp.

§ italic()

bool QgsLabelAttributes::italic ( ) const

Definition at line 226 of file qgslabelattributes.cpp.

§ italicIsSet()

bool QgsLabelAttributes::italicIsSet ( ) const

Definition at line 221 of file qgslabelattributes.cpp.

§ multilineEnabled()

bool QgsLabelAttributes::multilineEnabled ( ) const

Definition at line 420 of file qgslabelattributes.cpp.

§ offsetIsSet()

bool QgsLabelAttributes::offsetIsSet ( ) const

Definition at line 116 of file qgslabelattributes.cpp.

§ offsetType()

int QgsLabelAttributes::offsetType ( ) const

Definition at line 121 of file qgslabelattributes.cpp.

§ selectedOnly()

bool QgsLabelAttributes::selectedOnly ( ) const

Definition at line 430 of file qgslabelattributes.cpp.

§ setAlignment()

void QgsLabelAttributes::setAlignment ( int  alignment)

Definition at line 164 of file qgslabelattributes.cpp.

§ setAngle()

void QgsLabelAttributes::setAngle ( double  angle)

Definition at line 137 of file qgslabelattributes.cpp.

§ setAutoAngle()

void QgsLabelAttributes::setAutoAngle ( bool  state)

Definition at line 158 of file qgslabelattributes.cpp.

§ setBold()

void QgsLabelAttributes::setBold ( bool  enable)

Definition at line 198 of file qgslabelattributes.cpp.

§ setBorderColor()

void QgsLabelAttributes::setBorderColor ( const QColor color)

Definition at line 370 of file qgslabelattributes.cpp.

§ setBorderStyle()

void QgsLabelAttributes::setBorderStyle ( Qt::PenStyle  style)

Definition at line 403 of file qgslabelattributes.cpp.

§ setBorderWidth()

void QgsLabelAttributes::setBorderWidth ( int  width)

Definition at line 386 of file qgslabelattributes.cpp.

§ setBufferColor()

void QgsLabelAttributes::setBufferColor ( const QColor color)

Definition at line 336 of file qgslabelattributes.cpp.

§ setBufferEnabled()

void QgsLabelAttributes::setBufferEnabled ( bool  useBufferFlag)

Definition at line 309 of file qgslabelattributes.cpp.

§ setBufferSize()

void QgsLabelAttributes::setBufferSize ( double  size,
int  type 
)

Definition at line 313 of file qgslabelattributes.cpp.

§ setBufferStyle()

void QgsLabelAttributes::setBufferStyle ( Qt::BrushStyle  style)

Definition at line 353 of file qgslabelattributes.cpp.

§ setColor()

void QgsLabelAttributes::setColor ( const QColor color)

Definition at line 288 of file qgslabelattributes.cpp.

§ setFamily()

void QgsLabelAttributes::setFamily ( const QString family)

Definition at line 181 of file qgslabelattributes.cpp.

§ setItalic()

void QgsLabelAttributes::setItalic ( bool  enable)

Definition at line 215 of file qgslabelattributes.cpp.

§ setMultilineEnabled()

void QgsLabelAttributes::setMultilineEnabled ( bool  useMultiline)

Definition at line 424 of file qgslabelattributes.cpp.

§ setOffset()

void QgsLabelAttributes::setOffset ( double  x,
double  y,
int  type 
)

Definition at line 108 of file qgslabelattributes.cpp.

§ setSelectedOnly()

void QgsLabelAttributes::setSelectedOnly ( bool  selectedonly)

Definition at line 434 of file qgslabelattributes.cpp.

§ setSize()

void QgsLabelAttributes::setSize ( double  size,
int  type 
)

Definition at line 265 of file qgslabelattributes.cpp.

§ setStrikeOut()

void QgsLabelAttributes::setStrikeOut ( bool  enable)

Definition at line 248 of file qgslabelattributes.cpp.

§ setText()

void QgsLabelAttributes::setText ( const QString text)

Definition at line 90 of file qgslabelattributes.cpp.

§ setUnderline()

void QgsLabelAttributes::setUnderline ( bool  enable)

Definition at line 232 of file qgslabelattributes.cpp.

§ size()

double QgsLabelAttributes::size ( ) const

Definition at line 282 of file qgslabelattributes.cpp.

§ sizeIsSet()

bool QgsLabelAttributes::sizeIsSet ( ) const

Definition at line 272 of file qgslabelattributes.cpp.

§ sizeType()

int QgsLabelAttributes::sizeType ( ) const

Definition at line 277 of file qgslabelattributes.cpp.

§ strikeOut()

bool QgsLabelAttributes::strikeOut ( ) const

Definition at line 259 of file qgslabelattributes.cpp.

§ strikeOutIsSet()

bool QgsLabelAttributes::strikeOutIsSet ( ) const

Definition at line 254 of file qgslabelattributes.cpp.

§ text()

const QString QgsLabelAttributes::text ( ) const

Definition at line 101 of file qgslabelattributes.cpp.

§ textIsSet()

bool QgsLabelAttributes::textIsSet ( ) const

Definition at line 96 of file qgslabelattributes.cpp.

§ underline()

bool QgsLabelAttributes::underline ( ) const

Definition at line 243 of file qgslabelattributes.cpp.

§ underlineIsSet()

bool QgsLabelAttributes::underlineIsSet ( ) const

Definition at line 238 of file qgslabelattributes.cpp.

§ unitsCode()

int QgsLabelAttributes::unitsCode ( const QString name)
static

Definition at line 450 of file qgslabelattributes.cpp.

§ unitsName()

QString QgsLabelAttributes::unitsName ( int  units)
static

Definition at line 440 of file qgslabelattributes.cpp.

§ xOffset()

double QgsLabelAttributes::xOffset ( ) const

Definition at line 126 of file qgslabelattributes.cpp.

§ yOffset()

double QgsLabelAttributes::yOffset ( ) const

Definition at line 131 of file qgslabelattributes.cpp.

Member Data Documentation

§ mAlignment

int QgsLabelAttributes::mAlignment
protected

Alignment.

Definition at line 222 of file qgslabelattributes.h.

§ mAlignmentIsSet

bool QgsLabelAttributes::mAlignmentIsSet
protected

Definition at line 223 of file qgslabelattributes.h.

§ mAngle

double QgsLabelAttributes::mAngle
protected

Angle (degrees)

Definition at line 217 of file qgslabelattributes.h.

§ mAngleIsAuto

bool QgsLabelAttributes::mAngleIsAuto
protected

Definition at line 219 of file qgslabelattributes.h.

§ mAngleIsSet

bool QgsLabelAttributes::mAngleIsSet
protected

Definition at line 218 of file qgslabelattributes.h.

§ mBoldIsSet

bool QgsLabelAttributes::mBoldIsSet
protected

Definition at line 196 of file qgslabelattributes.h.

§ mBorderColorIsSet

bool QgsLabelAttributes::mBorderColorIsSet
protected

Definition at line 239 of file qgslabelattributes.h.

§ mBorderPen

QPen QgsLabelAttributes::mBorderPen
protected

Border pen (color, width, style)

Definition at line 238 of file qgslabelattributes.h.

§ mBorderStyleIsSet

bool QgsLabelAttributes::mBorderStyleIsSet
protected

Definition at line 241 of file qgslabelattributes.h.

§ mBorderWidthIsSet

bool QgsLabelAttributes::mBorderWidthIsSet
protected

Definition at line 240 of file qgslabelattributes.h.

§ mBufferBrush

QBrush QgsLabelAttributes::mBufferBrush
protected

Buffer brush (color, style)

Definition at line 233 of file qgslabelattributes.h.

§ mBufferColorIsSet

bool QgsLabelAttributes::mBufferColorIsSet
protected

Definition at line 234 of file qgslabelattributes.h.

§ mBufferEnabledFlag

bool QgsLabelAttributes::mBufferEnabledFlag
protected

Buffer enablement.

Definition at line 226 of file qgslabelattributes.h.

§ mBufferSize

double QgsLabelAttributes::mBufferSize
protected

Definition at line 229 of file qgslabelattributes.h.

§ mBufferSizeIsSet

bool QgsLabelAttributes::mBufferSizeIsSet
protected

Definition at line 230 of file qgslabelattributes.h.

§ mBufferSizeType

int QgsLabelAttributes::mBufferSizeType
protected

Buffer size, size type.

Definition at line 228 of file qgslabelattributes.h.

§ mBufferStyleIsSet

bool QgsLabelAttributes::mBufferStyleIsSet
protected

Definition at line 235 of file qgslabelattributes.h.

§ mColor

QColor QgsLabelAttributes::mColor
protected

Color.

Definition at line 207 of file qgslabelattributes.h.

§ mColorIsSet

bool QgsLabelAttributes::mColorIsSet
protected

Definition at line 208 of file qgslabelattributes.h.

§ mFamilyIsSet

bool QgsLabelAttributes::mFamilyIsSet
protected

Definition at line 195 of file qgslabelattributes.h.

§ mFont

QFont QgsLabelAttributes::mFont
protected

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

Definition at line 194 of file qgslabelattributes.h.

§ mItalicIsSet

bool QgsLabelAttributes::mItalicIsSet
protected

Definition at line 197 of file qgslabelattributes.h.

§ mMultilineEnabledFlag

bool QgsLabelAttributes::mMultilineEnabledFlag
protected

Multiline enablement.

Definition at line 244 of file qgslabelattributes.h.

§ mOffsetIsSet

bool QgsLabelAttributes::mOffsetIsSet
protected

Definition at line 214 of file qgslabelattributes.h.

§ mOffsetType

int QgsLabelAttributes::mOffsetType
protected

Offset.

Definition at line 211 of file qgslabelattributes.h.

§ mSelectedOnly

bool QgsLabelAttributes::mSelectedOnly
protected

Label only selected.

Definition at line 247 of file qgslabelattributes.h.

§ mSize

double QgsLabelAttributes::mSize
protected

Definition at line 203 of file qgslabelattributes.h.

§ mSizeIsSet

bool QgsLabelAttributes::mSizeIsSet
protected

Definition at line 204 of file qgslabelattributes.h.

§ mSizeType

int QgsLabelAttributes::mSizeType
protected

Font size, size type.

Definition at line 202 of file qgslabelattributes.h.

§ mStrikeOutIsSet

bool QgsLabelAttributes::mStrikeOutIsSet
protected

Definition at line 199 of file qgslabelattributes.h.

§ mText

QString QgsLabelAttributes::mText
protected

Definition at line 190 of file qgslabelattributes.h.

§ mTextIsSet

bool QgsLabelAttributes::mTextIsSet
protected

Definition at line 191 of file qgslabelattributes.h.

§ mUnderlineIsSet

bool QgsLabelAttributes::mUnderlineIsSet
protected

Definition at line 198 of file qgslabelattributes.h.

§ mXOffset

double QgsLabelAttributes::mXOffset
protected

Definition at line 212 of file qgslabelattributes.h.

§ mYOffset

double QgsLabelAttributes::mYOffset
protected

Definition at line 213 of file qgslabelattributes.h.


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