Qt 4.8
Public Functions | Public Variables | List of all members
QSvgStyle Class Reference

#include <qsvgstyle_p.h>

Public Functions

void apply (QPainter *p, const QSvgNode *node, QSvgExtraStates &states)
 
 QSvgStyle ()
 
void revert (QPainter *p, QSvgExtraStates &states)
 
 ~QSvgStyle ()
 

Public Variables

QSvgRefCounter< QSvgAnimateColoranimateColor
 
QList< QSvgRefCounter< QSvgAnimateTransform > > animateTransforms
 
QSvgRefCounter< QSvgCompOpStylecompop
 
QSvgRefCounter< QSvgFillStylefill
 
QSvgRefCounter< QSvgFontStylefont
 
QSvgRefCounter< QSvgGradientStylegradient
 
QSvgRefCounter< QSvgOpacityStyleopacity
 
QSvgRefCounter< QSvgQualityStylequality
 
QSvgRefCounter< QSvgSolidColorStylesolidColor
 
QSvgRefCounter< QSvgStrokeStylestroke
 
QSvgRefCounter< QSvgTransformStyletransform
 
QSvgRefCounter< QSvgViewportFillStyleviewportFill
 

Detailed Description

Definition at line 751 of file qsvgstyle_p.h.

Constructors and Destructors

◆ QSvgStyle()

QSvgStyle::QSvgStyle ( )
inline

Definition at line 754 of file qsvgstyle_p.h.

755  : quality(0),
756  fill(0),
757  viewportFill(0),
758  font(0),
759  stroke(0),
760  solidColor(0),
761  gradient(0),
762  transform(0),
763  animateColor(0),
764  opacity(0),
765  compop(0)
766  {}
QSvgRefCounter< QSvgGradientStyle > gradient
Definition: qsvgstyle_p.h:777
QSvgRefCounter< QSvgViewportFillStyle > viewportFill
Definition: qsvgstyle_p.h:773
QSvgRefCounter< QSvgOpacityStyle > opacity
Definition: qsvgstyle_p.h:781
QSvgRefCounter< QSvgCompOpStyle > compop
Definition: qsvgstyle_p.h:782
QSvgRefCounter< QSvgTransformStyle > transform
Definition: qsvgstyle_p.h:778
QSvgRefCounter< QSvgQualityStyle > quality
Definition: qsvgstyle_p.h:771
QSvgRefCounter< QSvgFillStyle > fill
Definition: qsvgstyle_p.h:772
QSvgRefCounter< QSvgAnimateColor > animateColor
Definition: qsvgstyle_p.h:779
QSvgRefCounter< QSvgStrokeStyle > stroke
Definition: qsvgstyle_p.h:775
QSvgRefCounter< QSvgFontStyle > font
Definition: qsvgstyle_p.h:774
QSvgRefCounter< QSvgSolidColorStyle > solidColor
Definition: qsvgstyle_p.h:776

◆ ~QSvgStyle()

QSvgStyle::~QSvgStyle ( )

Definition at line 520 of file qsvgstyle.cpp.

521 {
522 }

Functions

◆ apply()

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

Definition at line 524 of file qsvgstyle.cpp.

Referenced by QSvgNode::applyStyle().

525 {
526  if (quality) {
527  quality->apply(p, node, states);
528  }
529 
530  if (fill) {
531  fill->apply(p, node, states);
532  }
533 
534  if (viewportFill) {
535  viewportFill->apply(p, node, states);
536  }
537 
538  if (font) {
539  font->apply(p, node, states);
540  }
541 
542  if (stroke) {
543  stroke->apply(p, node, states);
544  }
545 
546  if (transform) {
547  transform->apply(p, node, states);
548  }
549 
550  if (animateColor) {
551  animateColor->apply(p, node, states);
552  }
553 
554  //animated transforms have to be applied
555  //_after_ the original object transformations
556  if (!animateTransforms.isEmpty()) {
557  qreal totalTimeElapsed = node->document()->currentElapsed();
558  // Find the last animateTransform with additive="replace", since this will override all
559  // previous animateTransforms.
561  do {
562  --itr;
563  if ((*itr)->animActive(totalTimeElapsed)
564  && (*itr)->additiveType() == QSvgAnimateTransform::Replace) {
565  // An animateTransform with additive="replace" will replace the transform attribute.
566  if (transform)
567  transform->revert(p, states);
568  break;
569  }
570  } while (itr != animateTransforms.constBegin());
571 
572  // Apply the animateTransforms after and including the last one with additive="replace".
573  for (; itr != animateTransforms.constEnd(); ++itr) {
574  if ((*itr)->animActive(totalTimeElapsed))
575  (*itr)->apply(p, node, states);
576  }
577  }
578 
579  if (opacity) {
580  opacity->apply(p, node, states);
581  }
582 
583  if (compop) {
584  compop->apply(p, node, states);
585  }
586 }
double qreal
Definition: qglobal.h:1193
virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:837
QSvgRefCounter< QSvgViewportFillStyle > viewportFill
Definition: qsvgstyle_p.h:773
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:295
QList< QSvgRefCounter< QSvgAnimateTransform > > animateTransforms
Definition: qsvgstyle_p.h:780
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:915
QSvgRefCounter< QSvgOpacityStyle > opacity
Definition: qsvgstyle_p.h:781
virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:92
QSvgRefCounter< QSvgCompOpStyle > compop
Definition: qsvgstyle_p.h:782
QSvgRefCounter< QSvgTransformStyle > transform
Definition: qsvgstyle_p.h:778
int currentElapsed() const
virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:504
virtual void revert(QPainter *p, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:452
QSvgRefCounter< QSvgQualityStyle > quality
Definition: qsvgstyle_p.h:771
QSvgRefCounter< QSvgFillStyle > fill
Definition: qsvgstyle_p.h:772
QSvgRefCounter< QSvgAnimateColor > animateColor
Definition: qsvgstyle_p.h:779
QSvgRefCounter< QSvgStrokeStyle > stroke
Definition: qsvgstyle_p.h:775
QSvgRefCounter< QSvgFontStyle > font
Definition: qsvgstyle_p.h:774
virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:227
virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:139
virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:172
QSvgTinyDocument * document() const
Definition: qsvgnode.cpp:233
virtual void apply(QPainter *p, const QSvgNode *node, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:446
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

◆ revert()

void QSvgStyle::revert ( QPainter p,
QSvgExtraStates states 
)

Definition at line 588 of file qsvgstyle.cpp.

Referenced by QSvgNode::revertStyle().

589 {
590  if (quality) {
591  quality->revert(p, states);
592  }
593 
594  if (fill) {
595  fill->revert(p, states);
596  }
597 
598  if (viewportFill) {
599  viewportFill->revert(p, states);
600  }
601 
602  if (font) {
603  font->revert(p, states);
604  }
605 
606  if (stroke) {
607  stroke->revert(p, states);
608  }
609 
610  //animated transforms need to be reverted _before_
611  //the native transforms
612  if (!animateTransforms.isEmpty()) {
614  for (; itr != animateTransforms.constEnd(); ++itr) {
615  if ((*itr)->transformApplied()) {
616  (*itr)->revert(p, states);
617  break;
618  }
619  }
620  for (; itr != animateTransforms.constEnd(); ++itr)
621  (*itr)->clearTransformApplied();
622  }
623 
624  if (transform) {
625  transform->revert(p, states);
626  }
627 
628  if (animateColor) {
629  animateColor->revert(p, states);
630  }
631 
632  if (opacity) {
633  opacity->revert(p, states);
634  }
635 
636  if (compop) {
637  compop->revert(p, states);
638  }
639 }
virtual void revert(QPainter *p, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:96
QSvgRefCounter< QSvgViewportFillStyle > viewportFill
Definition: qsvgstyle_p.h:773
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
virtual void revert(QPainter *p, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:157
virtual void revert(QPainter *p, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:178
virtual void revert(QPainter *p, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:895
QList< QSvgRefCounter< QSvgAnimateTransform > > animateTransforms
Definition: qsvgstyle_p.h:780
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QSvgRefCounter< QSvgOpacityStyle > opacity
Definition: qsvgstyle_p.h:781
QSvgRefCounter< QSvgCompOpStyle > compop
Definition: qsvgstyle_p.h:782
virtual void revert(QPainter *p, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:266
QSvgRefCounter< QSvgTransformStyle > transform
Definition: qsvgstyle_p.h:778
virtual void revert(QPainter *p, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:452
QSvgRefCounter< QSvgQualityStyle > quality
Definition: qsvgstyle_p.h:771
QSvgRefCounter< QSvgFillStyle > fill
Definition: qsvgstyle_p.h:772
virtual void revert(QPainter *p, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:510
QSvgRefCounter< QSvgAnimateColor > animateColor
Definition: qsvgstyle_p.h:779
QSvgRefCounter< QSvgStrokeStyle > stroke
Definition: qsvgstyle_p.h:775
virtual void revert(QPainter *p, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:381
QSvgRefCounter< QSvgFontStyle > font
Definition: qsvgstyle_p.h:774
virtual void revert(QPainter *p, QSvgExtraStates &states)
Definition: qsvgstyle.cpp:921
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

Properties

◆ animateColor

QSvgRefCounter<QSvgAnimateColor> QSvgStyle::animateColor

Definition at line 779 of file qsvgstyle_p.h.

Referenced by QSvgNode::appendStyleProperty(), and QSvgNode::styleProperty().

◆ animateTransforms

QList<QSvgRefCounter<QSvgAnimateTransform> > QSvgStyle::animateTransforms

Definition at line 780 of file qsvgstyle_p.h.

Referenced by QSvgNode::appendStyleProperty(), and QSvgNode::styleProperty().

◆ compop

QSvgRefCounter<QSvgCompOpStyle> QSvgStyle::compop

Definition at line 782 of file qsvgstyle_p.h.

Referenced by QSvgNode::appendStyleProperty(), and QSvgNode::styleProperty().

◆ fill

QSvgRefCounter<QSvgFillStyle> QSvgStyle::fill

Definition at line 772 of file qsvgstyle_p.h.

Referenced by QSvgNode::appendStyleProperty(), and QSvgNode::styleProperty().

◆ font

QSvgRefCounter<QSvgFontStyle> QSvgStyle::font

Definition at line 774 of file qsvgstyle_p.h.

Referenced by QSvgNode::appendStyleProperty(), and QSvgNode::styleProperty().

◆ gradient

QSvgRefCounter<QSvgGradientStyle> QSvgStyle::gradient

Definition at line 777 of file qsvgstyle_p.h.

Referenced by QSvgNode::appendStyleProperty(), and QSvgNode::styleProperty().

◆ opacity

QSvgRefCounter<QSvgOpacityStyle> QSvgStyle::opacity

Definition at line 781 of file qsvgstyle_p.h.

Referenced by QSvgNode::appendStyleProperty(), and QSvgNode::styleProperty().

◆ quality

QSvgRefCounter<QSvgQualityStyle> QSvgStyle::quality

Definition at line 771 of file qsvgstyle_p.h.

Referenced by QSvgNode::appendStyleProperty(), and QSvgNode::styleProperty().

◆ solidColor

QSvgRefCounter<QSvgSolidColorStyle> QSvgStyle::solidColor

Definition at line 776 of file qsvgstyle_p.h.

Referenced by QSvgNode::appendStyleProperty(), and QSvgNode::styleProperty().

◆ stroke

QSvgRefCounter<QSvgStrokeStyle> QSvgStyle::stroke

Definition at line 775 of file qsvgstyle_p.h.

Referenced by QSvgNode::appendStyleProperty(), and QSvgNode::styleProperty().

◆ transform

QSvgRefCounter<QSvgTransformStyle> QSvgStyle::transform

◆ viewportFill

QSvgRefCounter<QSvgViewportFillStyle> QSvgStyle::viewportFill

Definition at line 773 of file qsvgstyle_p.h.

Referenced by QSvgNode::appendStyleProperty(), and QSvgNode::styleProperty().


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