Krita Source Code Documentation
Loading...
Searching...
No Matches
KoKeepShapesSelectedCommand.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
8
9#include <KoShape.h>
10#include <KoSelection.h>
12
13
15 const QList<KoShape*> &selectedAfter,
16 KoSelectedShapesProxy *selectionProxy,
17 bool isFinalizing,
18 KUndo2Command *parent)
19 : KisCommandUtils::FlipFlopCommand(isFinalizing, parent),
20 m_selectedBefore(selectedBefore),
21 m_selectedAfter(selectedAfter),
22 m_selectionProxy(selectionProxy)
23{
24
25}
26
28{
30
31 selection->deselectAll();
32
33 const QList<KoShape*> newSelectedShapes =
34 getState() == FlipFlopCommand::State::FINALIZING ? m_selectedAfter : m_selectedBefore;
35
36 Q_FOREACH (KoShape *shape, newSelectedShapes) {
37 selection->select(shape);
38 }
39}
40
KoKeepShapesSelectedCommand(const QList< KoShape * > &selectedBefore, const QList< KoShape * > &selectedAfter, KoSelectedShapesProxy *selectionProxy, bool isFinalizing, KUndo2Command *parent)
The KoSelectedShapesProxy class is a special interface of KoCanvasBase to have a stable connection to...
virtual KoSelection * selection()=0
void deselectAll()
clear the selections list
void select(KoShape *shape)