Qt 4.8
Public Functions | Properties | List of all members
QSvgFillStyle Class Reference

#include <qsvgstyle_p.h>

Inheritance diagram for QSvgFillStyle:
QSvgStyleProperty QSvgRefCounted

Public Functions

virtual void apply (QPainter *p, const QSvgNode *node, QSvgExtraStates &states)
 
qreal fillOpacity () const
 
Qt::FillRule fillRule () const
 
QString gradientId () const
 
bool isGradientResolved () const
 
const QBrushqbrush () const
 
 QSvgFillStyle ()
 
virtual void revert (QPainter *p, QSvgExtraStates &states)
 
void setBrush (QBrush brush)
 
void setFillOpacity (qreal opacity)
 
void setFillRule (Qt::FillRule f)
 
void setFillStyle (QSvgFillStyleProperty *style)
 
void setGradientId (const QString &Id)
 
void setGradientResolved (bool resolved)
 
QSvgFillStylePropertystyle () const
 
virtual Type type () const
 
- Public Functions inherited from QSvgStyleProperty
virtual ~QSvgStyleProperty ()
 
- Public Functions inherited from QSvgRefCounted
void deref ()
 
 QSvgRefCounted ()
 
void ref ()
 
virtual ~QSvgRefCounted ()
 

Properties

QBrush m_fill
 
qreal m_fillOpacity
 
uint m_fillOpacitySet: 1
 
Qt::FillRule m_fillRule
 
uint m_fillRuleSet: 1
 
uint m_fillSet: 1
 
QString m_gradientId
 
uint m_gradientResolved: 1
 
QBrush m_oldFill
 
qreal m_oldFillOpacity
 
Qt::FillRule m_oldFillRule
 
QSvgFillStylePropertym_style
 

Additional Inherited Members

- Public Types inherited from QSvgStyleProperty
enum  Type {
  QUALITY, FILL, VIEWPORT_FILL, FONT,
  STROKE, SOLID_COLOR, GRADIENT, TRANSFORM,
  ANIMATE_TRANSFORM, ANIMATE_COLOR, OPACITY, COMP_OP
}
 

Detailed Description

Definition at line 232 of file qsvgstyle_p.h.

Constructors and Destructors

◆ QSvgFillStyle()

QSvgFillStyle::QSvgFillStyle ( )

Definition at line 101 of file qsvgstyle.cpp.

102  : m_style(0)
105  , m_fillOpacity(1.0)
106  , m_oldFillOpacity(0)
107  , m_gradientResolved(1)
108  , m_fillRuleSet(0)
109  , m_fillOpacitySet(0)
110  , m_fillSet(0)
111 {
112 }
qreal m_oldFillOpacity
Definition: qsvgstyle_p.h:295
qreal m_fillOpacity
Definition: qsvgstyle_p.h:294
uint m_fillOpacitySet
Definition: qsvgstyle_p.h:301
Qt::FillRule m_fillRule
Definition: qsvgstyle_p.h:292
QSvgFillStyleProperty * m_style
Definition: qsvgstyle_p.h:290
uint m_gradientResolved
Definition: qsvgstyle_p.h:298
uint m_fillRuleSet
Definition: qsvgstyle_p.h:300
Qt::FillRule m_oldFillRule
Definition: qsvgstyle_p.h:293

Functions

◆ apply()

void QSvgFillStyle::apply ( QPainter p,
const QSvgNode node,
QSvgExtraStates states 
)
virtual

Implements QSvgStyleProperty.

Definition at line 139 of file qsvgstyle.cpp.

140 {
141  m_oldFill = p->brush();
142  m_oldFillRule = states.fillRule;
143  m_oldFillOpacity = states.fillOpacity;
144 
145  if (m_fillRuleSet)
146  states.fillRule = m_fillRule;
147  if (m_fillSet) {
148  if (m_style)
149  p->setBrush(m_style->brush(p, states));
150  else
151  p->setBrush(m_fill);
152  }
153  if (m_fillOpacitySet)
154  states.fillOpacity = m_fillOpacity;
155 }
qreal m_oldFillOpacity
Definition: qsvgstyle_p.h:295
qreal m_fillOpacity
Definition: qsvgstyle_p.h:294
QBrush m_oldFill
Definition: qsvgstyle_p.h:289
uint m_fillOpacitySet
Definition: qsvgstyle_p.h:301
virtual QBrush brush(QPainter *p, QSvgExtraStates &states)=0
Qt::FillRule m_fillRule
Definition: qsvgstyle_p.h:292
QSvgFillStyleProperty * m_style
Definition: qsvgstyle_p.h:290
Qt::FillRule fillRule
Definition: qsvgstyle_p.h:150
const QBrush & brush() const
Returns the painter&#39;s current brush.
Definition: qpainter.cpp:4232
void setBrush(const QBrush &brush)
Sets the painter&#39;s brush to the given brush.
Definition: qpainter.cpp:4171
uint m_fillRuleSet
Definition: qsvgstyle_p.h:300
Qt::FillRule m_oldFillRule
Definition: qsvgstyle_p.h:293

◆ fillOpacity()

qreal QSvgFillStyle::fillOpacity ( ) const
inline

Definition at line 250 of file qsvgstyle_p.h.

251  {
252  return m_fillOpacity;
253  }
qreal m_fillOpacity
Definition: qsvgstyle_p.h:294

◆ fillRule()

Qt::FillRule QSvgFillStyle::fillRule ( ) const
inline

Definition at line 255 of file qsvgstyle_p.h.

256  {
257  return m_fillRule;
258  }
Qt::FillRule m_fillRule
Definition: qsvgstyle_p.h:292

◆ gradientId()

QString QSvgFillStyle::gradientId ( ) const
inline

Definition at line 270 of file qsvgstyle_p.h.

Referenced by QSvgHandler::resolveGradients().

271  {
272  return m_gradientId;
273  }
QString m_gradientId
Definition: qsvgstyle_p.h:297

◆ isGradientResolved()

bool QSvgFillStyle::isGradientResolved ( ) const
inline

Definition at line 280 of file qsvgstyle_p.h.

Referenced by QSvgHandler::resolveGradients().

281  {
282  return m_gradientResolved;
283  }
uint m_gradientResolved
Definition: qsvgstyle_p.h:298

◆ qbrush()

const QBrush& QSvgFillStyle::qbrush ( ) const
inline

Definition at line 245 of file qsvgstyle_p.h.

246  {
247  return m_fill;
248  }

◆ revert()

void QSvgFillStyle::revert ( QPainter p,
QSvgExtraStates states 
)
virtual

Implements QSvgStyleProperty.

Definition at line 157 of file qsvgstyle.cpp.

158 {
159  if (m_fillOpacitySet)
160  states.fillOpacity = m_oldFillOpacity;
161  if (m_fillSet)
162  p->setBrush(m_oldFill);
163  if (m_fillRuleSet)
164  states.fillRule = m_oldFillRule;
165 }
qreal m_oldFillOpacity
Definition: qsvgstyle_p.h:295
QBrush m_oldFill
Definition: qsvgstyle_p.h:289
uint m_fillOpacitySet
Definition: qsvgstyle_p.h:301
Qt::FillRule fillRule
Definition: qsvgstyle_p.h:150
void setBrush(const QBrush &brush)
Sets the painter&#39;s brush to the given brush.
Definition: qpainter.cpp:4171
uint m_fillRuleSet
Definition: qsvgstyle_p.h:300
Qt::FillRule m_oldFillRule
Definition: qsvgstyle_p.h:293

◆ setBrush()

void QSvgFillStyle::setBrush ( QBrush  brush)

Definition at line 132 of file qsvgstyle.cpp.

Referenced by parseBrush(), and QSvgHandler::resolveGradients().

133 {
134  m_fill = brush;
135  m_style = 0;
136  m_fillSet = 1;
137 }
QSvgFillStyleProperty * m_style
Definition: qsvgstyle_p.h:290

◆ setFillOpacity()

void QSvgFillStyle::setFillOpacity ( qreal  opacity)

Definition at line 120 of file qsvgstyle.cpp.

Referenced by parseBrush().

121 {
122  m_fillOpacitySet = 1;
123  m_fillOpacity = opacity;
124 }
qreal m_fillOpacity
Definition: qsvgstyle_p.h:294
uint m_fillOpacitySet
Definition: qsvgstyle_p.h:301

◆ setFillRule()

void QSvgFillStyle::setFillRule ( Qt::FillRule  f)

Definition at line 114 of file qsvgstyle.cpp.

Referenced by parseBrush().

115 {
116  m_fillRuleSet = 1;
117  m_fillRule = f;
118 }
Qt::FillRule m_fillRule
Definition: qsvgstyle_p.h:292
uint m_fillRuleSet
Definition: qsvgstyle_p.h:300

◆ setFillStyle()

void QSvgFillStyle::setFillStyle ( QSvgFillStyleProperty style)

Definition at line 126 of file qsvgstyle.cpp.

Referenced by parseBrush(), and QSvgHandler::resolveGradients().

127 {
128  m_style = style;
129  m_fillSet = 1;
130 }
QSvgFillStyleProperty * style() const
Definition: qsvgstyle_p.h:260
QSvgFillStyleProperty * m_style
Definition: qsvgstyle_p.h:290

◆ setGradientId()

void QSvgFillStyle::setGradientId ( const QString Id)
inline

Definition at line 265 of file qsvgstyle_p.h.

Referenced by parseBrush().

266  {
267  m_gradientId = Id;
268  }
QString m_gradientId
Definition: qsvgstyle_p.h:297

◆ setGradientResolved()

void QSvgFillStyle::setGradientResolved ( bool  resolved)
inline

Definition at line 275 of file qsvgstyle_p.h.

Referenced by parseBrush().

276  {
277  m_gradientResolved = resolved;
278  }
uint m_gradientResolved
Definition: qsvgstyle_p.h:298

◆ style()

QSvgFillStyleProperty* QSvgFillStyle::style ( ) const
inline

Definition at line 260 of file qsvgstyle_p.h.

Referenced by setFillStyle().

261  {
262  return m_style;
263  }
QSvgFillStyleProperty * m_style
Definition: qsvgstyle_p.h:290

◆ type()

QSvgStyleProperty::Type QSvgFillStyle::type ( ) const
virtual

Implements QSvgStyleProperty.

Definition at line 462 of file qsvgstyle.cpp.

463 {
464  return FILL;
465 }

Properties

◆ m_fill

QBrush QSvgFillStyle::m_fill
private

Definition at line 288 of file qsvgstyle_p.h.

Referenced by apply(), and setBrush().

◆ m_fillOpacity

qreal QSvgFillStyle::m_fillOpacity
private

Definition at line 294 of file qsvgstyle_p.h.

Referenced by apply(), and setFillOpacity().

◆ m_fillOpacitySet

uint QSvgFillStyle::m_fillOpacitySet
private

Definition at line 301 of file qsvgstyle_p.h.

Referenced by apply(), revert(), and setFillOpacity().

◆ m_fillRule

Qt::FillRule QSvgFillStyle::m_fillRule
private

Definition at line 292 of file qsvgstyle_p.h.

Referenced by apply(), and setFillRule().

◆ m_fillRuleSet

uint QSvgFillStyle::m_fillRuleSet
private

Definition at line 300 of file qsvgstyle_p.h.

Referenced by apply(), revert(), and setFillRule().

◆ m_fillSet

uint QSvgFillStyle::m_fillSet
private

Definition at line 302 of file qsvgstyle_p.h.

Referenced by apply(), revert(), setBrush(), and setFillStyle().

◆ m_gradientId

QString QSvgFillStyle::m_gradientId
private

Definition at line 297 of file qsvgstyle_p.h.

◆ m_gradientResolved

uint QSvgFillStyle::m_gradientResolved
private

Definition at line 298 of file qsvgstyle_p.h.

◆ m_oldFill

QBrush QSvgFillStyle::m_oldFill
private

Definition at line 289 of file qsvgstyle_p.h.

Referenced by apply(), and revert().

◆ m_oldFillOpacity

qreal QSvgFillStyle::m_oldFillOpacity
private

Definition at line 295 of file qsvgstyle_p.h.

Referenced by apply(), and revert().

◆ m_oldFillRule

Qt::FillRule QSvgFillStyle::m_oldFillRule
private

Definition at line 293 of file qsvgstyle_p.h.

Referenced by apply(), and revert().

◆ m_style

QSvgFillStyleProperty* QSvgFillStyle::m_style
private

Definition at line 290 of file qsvgstyle_p.h.

Referenced by apply(), setBrush(), and setFillStyle().


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