Krita Source Code Documentation
Loading...
Searching...
No Matches
KoShapeControllerBase.cpp
Go to the documentation of this file.
1/* This file is part of the KDE project
2
3 SPDX-FileCopyrightText: 2006, 2010 Thomas Zander <zander@kde.org>
4 SPDX-FileCopyrightText: 2011 Jan Hambrecht <jaham@gmx.net>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#include <QTransform>
10#include <QPointer>
11
14#include "KoShapeRegistry.h"
15#include "KoShapeFactoryBase.h"
16
17#include <kconfig.h>
18#include <kconfiggroup.h>
19#include <ksharedconfig.h>
20#include <kundo2command.h>
21
23{
24public:
27 {
29 foreach (const QString &id, registry->keys()) {
30 KoShapeFactoryBase *shapeFactory = registry->value(id);
32 }
33 // read persistent application wide resources
34 KSharedConfigPtr config = KSharedConfig::openConfig();
35 KConfigGroup miscGroup = config->group("Misc");
36 const uint grabSensitivity = miscGroup.readEntry("GrabSensitivity", 10);
37 resourceManager->setGrabSensitivity(grabSensitivity);
38 }
39
44
46};
47
52
57
59{
60 Q_UNUSED(parentCommand);
61 Q_UNUSED(forceNewLayer);
62 Q_UNUSED(shapes);
63
64 return 0;
65}
66
71
73{
74 const qreal pxToPt = 72.0 / pixelsPerInch();
75
76 QTransform t = QTransform::fromScale(pxToPt, pxToPt);
77 return t.mapRect(documentRectInPixels());
78}
unsigned int uint
const T value(const QString &id) const
QList< QString > keys() const
KoshapeControllerBasePrivate *const d
virtual qreal pixelsPerInch() const =0
virtual KoShapeContainer * createParentForShapes(const QList< KoShape * > shapes, bool forceNewLayer, KUndo2Command *parentCommand)
virtual QRectF documentRectInPixels() const =0
virtual KoDocumentResourceManager * resourceManager() const
virtual void newDocumentResourceManager(KoDocumentResourceManager *manager) const
static KoShapeRegistry * instance()
QPointer< KoDocumentResourceManager > resourceManager