Krita Source Code Documentation
Loading...
Searching...
No Matches
GroupShape Class Reference

The GroupShape class A group shape is a vector object with child shapes. More...

#include <GroupShape.h>

+ Inheritance diagram for GroupShape:

Public Slots

QList< Shape * > children ()
 children
 
QString type () const override
 type returns the type.
 
- Public Slots inherited from Shape
QTransform absoluteTransformation () const
 transformation the 2D transformation matrix of the shape including all grandparent transforms.
 
QRectF boundingBox () const
 boundingBox the bounding box of the shape in points
 
void deselect ()
 deselect deselects the shape.
 
bool geometryProtected () const
 geometryProtected
 
bool isSelected ()
 isSelected
 
QString name () const
 name
 
ShapeparentShape () const
 parentShape
 
QPointF position () const
 position the position of the shape in points.
 
bool remove ()
 remove delete the shape.
 
void select ()
 select selects the shape.
 
bool selectable () const
 selectable
 
void setGeometryProtected (bool protect)
 setGeometryProtected
 
void setName (const QString &name)
 setName
 
void setPosition (QPointF point)
 setPosition set the position of the shape.
 
void setSelectable (bool selectable)
 setSelectable
 
void setTransformation (QTransform matrix)
 setTransformation set the 2D transformation matrix of the shape.
 
void setVisible (bool visible)
 setVisible
 
void setZIndex (int zindex)
 setZIndex
 
QString toSvg (bool prependStyles=false, bool stripTextMode=true)
 toSvg convert the shape to svg, will not include style definitions.
 
QTransform transformation () const
 transformation the 2D transformation matrix of the shape.
 
virtual QString type () const
 type
 
void update ()
 update queue the shape update.
 
void updateAbsolute (QRectF box)
 updateAbsolute queue the shape update in the specified rectangle.
 
bool visible () const
 visible
 
int zIndex () const
 zIndex
 

Public Member Functions

 GroupShape (KoShapeGroup *shape, QObject *parent=0)
 
 GroupShape (QObject *parent=0)
 
 ~GroupShape ()
 
- Public Member Functions inherited from Shape
bool operator!= (const Shape &other) const
 
bool operator== (const Shape &other) const
 
 Shape (KoShape *shape, QObject *parent=0)
 
 ~Shape ()
 

Detailed Description

The GroupShape class A group shape is a vector object with child shapes.

Definition at line 20 of file GroupShape.h.

Constructor & Destructor Documentation

◆ GroupShape() [1/2]

GroupShape::GroupShape ( QObject * parent = 0)
explicit

Definition at line 9 of file GroupShape.cpp.

9 : Shape(new KoShapeGroup(), parent)
10{
11}
Shape(KoShape *shape, QObject *parent=0)
Definition Shape.cpp:31

◆ GroupShape() [2/2]

GroupShape::GroupShape ( KoShapeGroup * shape,
QObject * parent = 0 )

Definition at line 13 of file GroupShape.cpp.

13 :
14 Shape(shape, parent)
15{
16
17}
KoShape * shape()
Definition Shape.cpp:236

◆ ~GroupShape()

GroupShape::~GroupShape ( )

Definition at line 19 of file GroupShape.cpp.

20{
21
22}

Member Function Documentation

◆ children

QList< Shape * > GroupShape::children ( )
slot

children

Returns
the child shapes of this group shape.

Definition at line 30 of file GroupShape.cpp.

31{
32 KoShapeGroup * group = dynamic_cast<KoShapeGroup*>(this->shape());
33 QList <Shape*> shapes;
34 if (group) {
35 QList<KoShape*> originalShapes = group->shapes();
36 std::sort(originalShapes.begin(), originalShapes.end(), KoShape::compareShapeZIndex);
37 for(int i=0; i<group->shapeCount(); i++) {
38 if (dynamic_cast<KoShapeGroup*>(originalShapes.at(i))) {
39 shapes << new GroupShape(dynamic_cast<KoShapeGroup*>(originalShapes.at(i)));
40 } else {
41 shapes << new Shape(originalShapes.at(i));
42 }
43 }
44 }
45 return shapes;
46}
QList< KoShape * > shapes() const
static bool compareShapeZIndex(KoShape *s1, KoShape *s2)
Definition KoShape.cpp:434

References KoShape::compareShapeZIndex(), Shape::shape(), Shape::Shape(), KoShapeContainer::shapeCount(), and KoShapeContainer::shapes().

◆ type

QString GroupShape::type ( ) const
overrideslot

type returns the type.

Returns
"groupshape"

Definition at line 24 of file GroupShape.cpp.

25{
26 //Has no default KoID
27 return "groupshape";
28}

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