Krita Source Code Documentation
Loading...
Searching...
No Matches
KisRootSurfaceInfoProxy.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef KISROOTSURFACEINFOPROXY_H
7#define KISROOTSURFACEINFOPROXY_H
8
9#include <kritaui_export.h>
10
11#include <QObject>
12#include <QPointer>
13
15class QWidget;
16class QWindow;
17class QEvent;
18class KoColorProfile;
19
45class KRITAUI_EXPORT KisRootSurfaceInfoProxy : public QObject
46{
47 Q_OBJECT
48public:
49 KisRootSurfaceInfoProxy(QWidget *watched, QObject *parent = nullptr);
51 const KoColorProfile* rootSurfaceProfile() const;
52 bool isReady() const;
53
54 QString colorManagementReport() const;
55 QString osPreferredColorSpaceReport() const;
56
57Q_SIGNALS:
58 void sigRootSurfaceProfileChanged(const KoColorProfile *profile) const;
59
60private:
61
62 bool eventFilter(QObject *watched, QEvent *event) override;
63
64 void tryUpdateHierarchy();
65 void tryReconnectSurfaceManager();
66 void tryUpdateRootSurfaceProfile();
67
68 QVector<QPointer<QObject>> getCurrentHierarchy(QWidget *wdg);
69
70 void reconnectToHierarchy(const QVector<QPointer<QObject>> newHierarchy);
71
72private:
73 QWidget *m_watched {nullptr};
75
77
80
82 QMetaObject::Connection m_surfaceManagerConnection;
83
84 const KoColorProfile* m_rootSurfaceProfile {nullptr};
85
86};
87
88#endif /* KISROOTSURFACEINFOPROXY_H */
QMetaObject::Connection m_surfaceManagerConnection
QPointer< QObject > m_childChangedFilter
QPointer< KisSRGBSurfaceColorSpaceManager > m_topLevelSurfaceManager
QPointer< QWidget > m_topLevelWidgetWithSurface
QPointer< QWindow > m_topLevelNativeWindow
void sigRootSurfaceProfileChanged(const KoColorProfile *profile) const
QVector< QPointer< QObject > > m_watchedHierarchy