Krita Source Code Documentation
Loading...
Searching...
No Matches
KisSelectedShapesProxy.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
7#include <QPointer>
9
11#include <KoShapeManager.h>
12#include <KoSelection.h>
13
14
21
23 : m_d(new Private())
24{
25 m_d->globalShapeManager = globalShapeManager;
26
27 connect(m_d->globalShapeManager->selection(),
28 SIGNAL(currentLayerChanged(const KoShapeLayer*)),
29 SIGNAL(currentLayerChanged(const KoShapeLayer*)));
30}
31
36
38{
39 if (shapeManager != m_d->shapeManager) {
40 m_d->shapeManager = shapeManager;
41
42 m_d->shapeManagerConnections.clear();
43
44 if (m_d->shapeManager) {
45 m_d->shapeManagerConnections.addConnection(
46 m_d->shapeManager, SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged()));
47 m_d->shapeManagerConnections.addConnection(
48 m_d->shapeManager, SIGNAL(selectionContentChanged()), this, SIGNAL(selectionContentChanged()));
49 }
50
51 Q_EMIT selectionChanged();
52 }
53}
54
56{
57 return m_d->shapeManager ?
58 m_d->shapeManager->selection() :
59 m_d->globalShapeManager->selection();
60}
61
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
KisSelectedShapesProxy(KoShapeManager *globalShapeManager)
void currentLayerChanged(const KoShapeLayer *layer)
QScopedPointer< Private > m_d
KoSelection * selection() override
void setShapeManager(KoShapeManager *manager)
KisSignalAutoConnectionsStore shapeManagerConnections
QPointer< KoShapeManager > shapeManager