Shape

Search for usage in LXR

#include <Shape.h>

Inheritance diagram for Shape:

Public Slots

QTransform absoluteTransformation () const
 
QRectF boundingBox () const
 
void deselect ()
 
bool geometryProtected () const
 
bool isSelected ()
 
QString name () const
 
Shape * parentShape () const
 
QPointF position () const
 
bool remove ()
 
void select ()
 
bool selectable () const
 
void setGeometryProtected (bool protect)
 
void setName (const QString &name)
 
void setPosition (QPointF point)
 
void setSelectable (bool selectable)
 
void setTransformation (QTransform matrix)
 
void setVisible (bool visible)
 
void setZIndex (int zindex)
 
QString toSvg (bool prependStyles=false, bool stripTextMode=true)
 
QTransform transformation () const
 
virtual QString type () const
 
void update ()
 
void updateAbsolute (QRectF box)
 
bool visible () const
 
int zIndex () const
 

Public Member Functions

 Shape (KoShape *shape, QObject *parent=0)
 
bool operator!= (const Shape &other) const
 
bool operator== (const Shape &other) const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QString > bindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectList & children () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArray > dynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObject * parent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
T qobject_cast (const QObject *object)
 
T qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThread * thread () const const
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObject * sender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

The Shape class The shape class is a wrapper around Krita's vector objects.

Some example code to parse through interesting information in a given vector layer with shapes.

import sys
from krita import *
doc = Application.activeDocument()
root = doc.rootNode()
for layer in root.childNodes():
print (str(layer.type())+" "+str(layer.name()))
if (str(layer.type())=="vectorlayer"):
for shape in layer.shapes():
print(shape.name())
print(shape.toSvg())
QString name() const
name
Definition Shape.cpp:53
QString toSvg(bool prependStyles=false, bool stripTextMode=true)
toSvg convert the shape to svg, will not include style definitions.
Definition Shape.cpp:172

Definition at line 37 of file Shape.h.

Constructor & Destructor Documentation

◆ Shape()

Shape::Shape ( KoShape * shape,
QObject * parent = 0 )
explicit

Definition at line 31 of file Shape.cpp.

◆ ~Shape()

Shape::~Shape ( )

Definition at line 38 of file Shape.cpp.

Member Function Documentation

◆ absoluteTransformation

QTransform Shape::absoluteTransformation ( ) const
slot

transformation the 2D transformation matrix of the shape including all grandparent transforms.

Returns
the 2D transformation matrix.

Definition at line 133 of file Shape.cpp.

◆ boundingBox

QRectF Shape::boundingBox ( ) const
slot

boundingBox the bounding box of the shape in points

Returns
RectF containing the bounding box.

Definition at line 108 of file Shape.cpp.

◆ deselect

void Shape::deselect ( )
slot

deselect deselects the shape.

Definition at line 203 of file Shape.cpp.

◆ geometryProtected

bool Shape::geometryProtected ( ) const
slot

geometryProtected

Returns
whether the shape is protected from user changing the shape geometry.

Definition at line 88 of file Shape.cpp.

◆ isSelected

bool Shape::isSelected ( )
slot

isSelected

Returns
whether the shape is selected.

Definition at line 213 of file Shape.cpp.

◆ name

QString Shape::name ( ) const
slot

name

Returns
the name of the shape

Definition at line 53 of file Shape.cpp.

◆ operator!=()

bool Shape::operator!= ( const Shape & other) const

Definition at line 48 of file Shape.cpp.

◆ operator==()

bool Shape::operator== ( const Shape & other) const

Definition at line 43 of file Shape.cpp.

◆ parentShape

Shape * Shape::parentShape ( ) const
slot

parentShape

Returns
the parent GroupShape of the current shape.

Definition at line 223 of file Shape.cpp.

◆ position

QPointF Shape::position ( ) const
slot

position the position of the shape in points.

Returns
the position of the shape in points.

Definition at line 113 of file Shape.cpp.

◆ remove

bool Shape::remove ( )
slot

remove delete the shape.

Definition at line 148 of file Shape.cpp.

◆ select

void Shape::select ( )
slot

select selects the shape.

Definition at line 193 of file Shape.cpp.

◆ selectable

bool Shape::selectable ( ) const
slot

selectable

Returns
whether the shape is user selectable.

Definition at line 78 of file Shape.cpp.

◆ setGeometryProtected

void Shape::setGeometryProtected ( bool protect)
slot

setGeometryProtected

Parameters
protectwhether the shape should be geometry protected from the user.

Definition at line 93 of file Shape.cpp.

◆ setName

void Shape::setName ( const QString & name)
slot

setName

Parameters
namewhich name the shape should have.

Definition at line 58 of file Shape.cpp.

◆ setPosition

void Shape::setPosition ( QPointF point)
slot

setPosition set the position of the shape.

Parameters
pointthe new position in points

Definition at line 118 of file Shape.cpp.

◆ setSelectable

void Shape::setSelectable ( bool selectable)
slot

setSelectable

Parameters
selectablewhether the shape should be user selectable.

Definition at line 83 of file Shape.cpp.

◆ setTransformation

void Shape::setTransformation ( QTransform matrix)
slot

setTransformation set the 2D transformation matrix of the shape.

Parameters
matrixthe new 2D transformation matrix.

Definition at line 128 of file Shape.cpp.

◆ setVisible

void Shape::setVisible ( bool visible)
slot

setVisible

Parameters
visiblewhether the shape should be visible.

Definition at line 103 of file Shape.cpp.

◆ setZIndex

void Shape::setZIndex ( int zindex)
slot

setZIndex

Parameters
zindexset the shape zindex value.

Definition at line 73 of file Shape.cpp.

◆ toSvg

QString Shape::toSvg ( bool prependStyles = false,
bool stripTextMode = true )
slot

toSvg convert the shape to svg, will not include style definitions.

Parameters
prependStylesprepend the style data. Default: false
stripTextModeenable strip text mode. Default: true
Returns
the svg in a string.

Definition at line 172 of file Shape.cpp.

◆ transformation

QTransform Shape::transformation ( ) const
slot

transformation the 2D transformation matrix of the shape.

Returns
the 2D transformation matrix.

Definition at line 123 of file Shape.cpp.

◆ type

QString Shape::type ( ) const
virtualslot

type

Returns
the type of shape.

Definition at line 63 of file Shape.cpp.

◆ update

void Shape::update ( )
slot

update queue the shape update.

Definition at line 138 of file Shape.cpp.

◆ updateAbsolute

void Shape::updateAbsolute ( QRectF box)
slot

updateAbsolute queue the shape update in the specified rectangle.

Parameters
boxthe RectF rectangle to update.

Definition at line 143 of file Shape.cpp.

◆ visible

bool Shape::visible ( ) const
slot

visible

Returns
whether the shape is visible.

Definition at line 98 of file Shape.cpp.

◆ zIndex

int Shape::zIndex ( ) const
slot

zIndex

Returns
the zindex of the shape.

Definition at line 68 of file Shape.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri May 2 2025 12:05:08 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.