KDEGames
kgamesvgdocument.h
46 * To find a node with a specific value in its id attribute, for example where id="playerOneGamepiece":
51 * QDomNode playerOneGamepiece = svgDom.elementByUniqueAttributeValue("id", "playerOneGamepiece");
54 * Most methods operate on the last node found by @c elementById() or @c elementByUniqueAttributeValue().
63 * svgDom.setStyleProperty("fill", "#ffffff"); // INCORRECT: playerTwoGamepiece is the last node, not playerOneGamepiece
75 * @warning Be careful when using the KGameSvgDocument::ApplyToCurrentMatrix flag. It multiplies the matrices,
76 * so if you repeatedly apply the same matrix to a node, you have a polynomial series @c x^2, and you will
172 QDomNode elementByUniqueAttributeValue(const QString &attributeName, const QString &attributeValue);
338 * @brief Builds a new svg document and returns a QByteArray suitable for passing to QSvgRenderer::load().
436 * that may be human-edited later, for consistency. There is a performance hit, since hashes store
440 * @param options Apply the hash so the properties are in the same order as Inkscape writes them.
444 void setStyleProperties(const QHash<QString, QString> &_styleProperties, const StylePropertySortOptions &options = Unsorted);
void translate(int xPixels, int yPixels, MatrixOptions options=ApplyToCurrentMatrix)
Moves the origin of the current node.
Definition kgamesvgdocument.cpp:226
void setTransformMatrix(QTransform &matrix, MatrixOptions options=ApplyToCurrentMatrix)
Sets the transform attribute of the current node.
Definition kgamesvgdocument.cpp:576
void scale(double xFactor, double yFactor, MatrixOptions options=ApplyToCurrentMatrix)
Scales the origin of the current node.
Definition kgamesvgdocument.cpp:260
QDomNodeList linearGradients() const
Returns the linearGradients in the document.
Definition kgamesvgdocument.cpp:378
void setTransform(const QString &transformAttribute)
Sets the transform attribute of the current node.
Definition kgamesvgdocument.cpp:403
QFlags< MatrixOption > MatrixOptions
Q_DECLARE_FLAGS macro confuses doxygen, so create typedef's manually.
Definition kgamesvgdocument.h:137
void rotate(double degrees, MatrixOptions options=ApplyToCurrentMatrix)
Rotates the origin of the current node counterclockwise.
Definition kgamesvgdocument.cpp:213
void setStyleProperties(const QHash< QString, QString > &_styleProperties, const StylePropertySortOptions &options=Unsorted)
Sets the style properties of the current node.
Definition kgamesvgdocument.cpp:431
void setSvgFilename(const QString &svgFilename)
Sets the current SVG filename.
Definition kgamesvgdocument.cpp:292
void setStyleProperty(const QString &propertyName, const QString &propertyValue)
Sets the value of the style property given for the current node.
Definition kgamesvgdocument.cpp:302
QString svgFilename() const
Returns the name of the SVG file this DOM represents.
Definition kgamesvgdocument.cpp:287
QHash< QString, QString > styleProperties() const
Returns a hash of the style properties of the current node.
Definition kgamesvgdocument.cpp:408
QString nodeToSvg() const
Returns the current node and its children as a new xml svg document.
Definition kgamesvgdocument.cpp:312
void shear(double xRadians, double yRadians, MatrixOptions options=ApplyToCurrentMatrix)
Shears the origin of the current node.
Definition kgamesvgdocument.cpp:239
QString styleProperty(const QString &propertyName) const
Returns the value of the style property given for the current node.
Definition kgamesvgdocument.cpp:297
MatrixOption
Options for applying (multiplying) or replacing the current matrix.
Definition kgamesvgdocument.h:126
QDomNodeList radialGradients() const
Returns the radialGradients in the document.
Definition kgamesvgdocument.cpp:383
void setStyle(const QString &styleAttribute)
Sets the style attribute of the current node.
Definition kgamesvgdocument.cpp:368
QDomNodeList patterns() const
Returns the patterns in the document.
Definition kgamesvgdocument.cpp:373
QString transform() const
Returns the transform attribute of the current node.
Definition kgamesvgdocument.cpp:398
QTransform transformMatrix() const
Returns the transform attribute of the current node as a matrix.
Definition kgamesvgdocument.cpp:466
QString style() const
Returns the style attribute of the current node.
Definition kgamesvgdocument.cpp:363
QDomNode currentNode() const
Returns the last node found by elementById, or null if node not found.
Definition kgamesvgdocument.cpp:276
void skew(double xDegrees, double yDegrees, MatrixOptions options=ApplyToCurrentMatrix)
Skews the origin of the current node.
Definition kgamesvgdocument.cpp:252
QDomNode elementByUniqueAttributeValue(const QString &attributeName, const QString &attributeValue)
Returns the node with the given value for the given attribute.
Definition kgamesvgdocument.cpp:154
QByteArray nodeToByteArray() const
Builds a new svg document and returns a QByteArray suitable for passing to QSvgRenderer::load().
Definition kgamesvgdocument.cpp:358
StylePropertySortOption
Options for sorting style properties when building a style attribute.
Definition kgamesvgdocument.h:142
@ UseInkscapeOrder
When building a style attribute, sort properties the same way Inkscape does.
Definition kgamesvgdocument.h:150
QFlags< StylePropertySortOption > StylePropertySortOptions
Q_DECLARE_FLAGS macro confuses doxygen, so create typedef's manually.
Definition kgamesvgdocument.h:153
QDomDocument()
QDomElement elementById(const QString &elementId)
QDomDocument & operator=(const QDomDocument &x)
QDomNode()
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Thu Jan 23 2025 18:49:14 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Thu Jan 23 2025 18:49:14 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.