49 qWarning() <<
"WARNING: KoSelection::setSize() should never be used!";
66 invertedTransform.map(
98 d->selectedShapes << shape;
101 if (
d->selectedShapes.size() == 1) {
107 d->selectionChangedCompressor->start();
112 if (!
d->selectedShapes.contains(shape))
115 d->selectedShapes.removeAll(shape);
118 if (
d->selectedShapes.size() == 1) {
122 d->selectionChangedCompressor->start();
128 if (
d->selectedShapes.isEmpty())
131 Q_FOREACH (
KoShape *shape,
d->selectedShapes) {
138 d->selectedShapes.clear();
139 d->selectionChangedCompressor->start();
144 return d->selectedShapes.size();
150 Q_FOREACH (
KoShape *shape,
d->selectedShapes) {
160 return d->selectedShapes;
190 if (delegates.isEmpty()) {
191 shapes.append(shape);
193 Q_FOREACH (
KoShape *delegatedShape, delegates) {
194 shapes.append(delegatedShape);
206 const KoShape *tmpShape = shape;
207 while (tmpShape && std::find(
d->selectedShapes.begin(),
d->selectedShapes.end(), tmpShape) ==
d->selectedShapes.end()) {
208 tmpShape = tmpShape->
parent();
216 return !
d->selectedShapes.isEmpty() ?
d->selectedShapes.first() : 0;
221 d->activeLayer = layer;
227 return d->activeLayer;
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
const QList< KoShape * > selectedVisibleShapes() const
QRectF outlineRect() const override
KoSelection(QObject *parent=0)
bool isSelected(const KoShape *shape) const
return true if the shape is selected
bool hitTest(const QPointF &position) const override
Check if the shape is hit on position.
void deselectAll()
clear the selections list
QSizeF size() const override
Get the size of the shape in pt.
QRectF boundingRect() const override
Get the bounding box of the shape.
void setActiveLayer(KoShapeLayer *layer)
void currentLayerChanged(const KoShapeLayer *layer)
emitted when the current layer is changed
void selectionChanged()
emitted when the selection is changed
QSharedDataPointer< Private > d
void deselect(KoShape *shape)
void setSize(const QSizeF &size) override
Resize the shape.
const QList< KoShape * > selectedEditableShapesAndDelegates() const
void select(KoShape *shape)
int count() const
return the selection count, i.e. the number of all selected shapes
void paint(QPainter &painter) const override
Paint the shape fill The class extending this one is responsible for painting itself....
void notifyShapeChanged(ChangeType type, KoShape *shape) override
const QList< KoShape * > selectedEditableShapes() const
KoShape * firstSelectedShape() const
const QList< KoShape * > selectedShapes() const
KoShapeLayer * activeLayer() const
virtual QRectF outlineRect() const
void addShapeChangeListener(ShapeChangeListener *listener)
bool isSelectable() const
void removeShapeChangeListener(ShapeChangeListener *listener)
virtual bool isShapeEditable(bool recursive=true) const
checks recursively if the shape or one of its parents is not visible or locked
QSet< KoShape * > toolDelegates() const
virtual QRectF boundingRect() const
Get the bounding box of the shape.
KoShapeContainer * parent() const
QTransform absoluteTransformation() const
void setTransformation(const QTransform &matrix)
ChangeType
Used by shapeChanged() to select which change was made.
@ Deleted
the shape was deleted
QTransform transformation() const
Returns the shapes local transformation matrix.
virtual bool hitTest(const QPointF &position) const
Check if the shape is hit on position.
bool isVisible(bool recursive=true) const
QPointF position() const
Get the position of the shape in pt.
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
auto filterContainer(C &container, KeepIfFunction keepIf) -> decltype(bool(keepIf(container[0])), void())