12#include <klocalizedstring.h>
40 m_d(new
Private(container, shapes, topLevelShapes))
59 perspectiveSiblings = newParent->
shapes();
62 perspectiveSiblings =
m_d->topLevelShapes;
65 Q_FOREACH (
KoShape *shape, perspectiveSiblings) {
66 indexedSiblings.append(shape);
71 auto insertIt = std::upper_bound(indexedSiblings.begin(),
72 indexedSiblings.end(),
73 IndexedShape(
m_d->container));
75 std::copy(
m_d->shapes.begin(),
m_d->shapes.end(),
76 std::inserter(indexedSiblings, insertIt));
80 const QTransform ungroupTransform =
m_d->container->absoluteTransformation();
81 for (
auto it =
m_d->shapes.begin(); it !=
m_d->shapes.end(); ++it) {
89 if (!indexedSiblings.isEmpty()) {
91 m_d->shapesReorderCommand->redo();
97 const QTransform groupTransform =
m_d->container->absoluteTransformation().inverted();
98 for (
auto it =
m_d->shapes.begin(); it !=
m_d->shapes.end(); ++it) {
105 if (
m_d->shapesReorderCommand) {
106 m_d->shapesReorderCommand->undo();
107 m_d->shapesReorderCommand.reset();
void setText(const KUndo2MagicString &text)
QList< KoShape * > shapes() const
This command allows you to change the zIndex of a number of shapes.
static QList< KoShapeReorderCommand::IndexedShape > homogenizeZIndexesLazy(QList< IndexedShape > shapes)
void undo() override
revert the actions done in redo
void redo() override
redo the command
KoShapeUngroupCommand(KoShapeContainer *container, const QList< KoShape * > &shapes, const QList< KoShape * > &topLevelShapes=QList< KoShape * >(), KUndo2Command *parent=0)
const QScopedPointer< Private > m_d
void applyAbsoluteTransformation(const QTransform &matrix)
static bool compareShapeZIndex(KoShape *s1, KoShape *s2)
KoShapeContainer * parent() const
void setParent(KoShapeContainer *parent)
#define KIS_SAFE_ASSERT_RECOVER(cond)
KUndo2MagicString kundo2_i18n(const char *text)
Private(KoShapeContainer *_container, const QList< KoShape * > &_shapes, const QList< KoShape * > &_topLevelShapes)
KoShapeContainer * container
QList< KoShape * > topLevelShapes
QList< KoShape * > shapes
QScopedPointer< KUndo2Command > shapesReorderCommand