Krita Source Code Documentation
Loading...
Searching...
No Matches
TextPropertiesCanvasObserver.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef TEXTPROPERTIESMANAGER_H
7#define TEXTPROPERTIESMANAGER_H
8
9#include <QObject>
11
12#include <kis_canvas2.h>
13#include <KoResource.h>
16
29{
30 Q_OBJECT
31 Q_PROPERTY(qreal dpi READ dpi() NOTIFY dpiChanged)
32 Q_PROPERTY(QStringList locales READ locales() NOTIFY localesChanged)
35 /*
36 * \qmlproperty hasFocus
37 * whether the related widget has foxus. Used to use to figure out whether
38 * we want to let the current signal compressor go on(hasFocus = true), or
39 * whether we want to retrieve the new text property data from the canvas
40 * resource provider (hasFocus = false).
41 */
42 Q_PROPERTY(bool hasFocus READ hasFocus WRITE setHasFocus NOTIFY hasFocusChanged)
43public:
44 explicit TextPropertiesCanvasObserver(QObject *parent = nullptr);
46
47 QString observerName() override { return "TextPropertiesCanvasObserver"; }
48 void setViewManager(KisViewManager *kisview) override;
49 void setCanvas(KoCanvasBase *canvas) override;
50 void unsetCanvas() override;
51
52 qreal dpi() const;
53 QStringList locales() const;
56
57 bool hasFocus() const;
58 void setHasFocus(const bool focus);
59
60public Q_SLOTS:
63
65
66 void applyPreset(KoResourceSP resource);
68 void editPreset(KoResourceSP resource);
69 void cloneAndEditPreset(KoResourceSP resource);
70Q_SIGNALS:
71 void dpiChanged();
76private:
77 struct Private;
78 const QScopedPointer<Private> d;
80};
81
82#endif // TEXTPROPERTIESMANAGER_H
The KisMainwindowObserver class is an interface for dock widgets that want to keep track of the main ...
The KoSvgTextPropertiesModel class.
The TextPropertiesCanvasObserver class.
TextPropertyConfigModel * textPropertyConfig
const QScopedPointer< Private > d
void cloneAndEditPreset(KoResourceSP resource)
void setCanvas(KoCanvasBase *canvas) override
localesChangedKoSvgTextPropertiesModel * textProperties
void setViewManager(KisViewManager *kisview) override