Krita Source Code Documentation
Loading...
Searching...
No Matches
KisRootSurfaceTrackerBase.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 KISROOTSURFACETRACKERBASE_H
7
#define KISROOTSURFACETRACKERBASE_H
8
9
#include <kritawidgetutils_export.h>
10
11
#include <QObject>
12
#include <QPointer>
13
14
class
QWidget;
15
class
QWindow;
16
class
QEvent;
17
37
class
KRITAWIDGETUTILS_EXPORT
KisRootSurfaceTrackerBase
:
public
QObject
38
{
39
Q_OBJECT
40
public
:
41
KisRootSurfaceTrackerBase
(QWidget *watched, QObject *parent =
nullptr
);
42
~KisRootSurfaceTrackerBase
();
43
44
QWidget* trackedWidget()
const
;
45
46
protected
:
47
virtual
void
connectToNativeWindow
(QWindow *nativeWindow) = 0;
48
virtual
void
disconnectFromNativeWindow
() = 0;
49
void
initialize();
50
51
private
:
52
53
bool
eventFilter(QObject *watched, QEvent *event)
override
;
54
55
void
tryUpdateHierarchy();
56
void
tryReconnectToNativeWindow();
57
58
QVector<QPointer<QObject>
> getCurrentHierarchy(QWidget *wdg);
59
60
void
reconnectToHierarchy(
const
QVector
<
QPointer<QObject>
> newHierarchy);
61
62
private
:
63
QWidget *m_watched {
nullptr
};
64
QVector<QPointer<QObject>
>
m_watchedHierarchy
;
65
66
QPointer<QWidget>
m_topLevelWidgetWithSurface
;
67
68
QPointer<QWindow>
m_topLevelNativeWindow
;
69
QPointer<QObject>
m_childChangedFilter
;
70
};
71
72
#endif
/* KISROOTSURFACETRACKERBASE_H */
KisRootSurfaceTrackerBase
Definition
KisRootSurfaceTrackerBase.h:38
KisRootSurfaceTrackerBase::m_topLevelNativeWindow
QPointer< QWindow > m_topLevelNativeWindow
Definition
KisRootSurfaceTrackerBase.h:68
KisRootSurfaceTrackerBase::disconnectFromNativeWindow
virtual void disconnectFromNativeWindow()=0
KisRootSurfaceTrackerBase::connectToNativeWindow
virtual void connectToNativeWindow(QWindow *nativeWindow)=0
KisRootSurfaceTrackerBase::m_childChangedFilter
QPointer< QObject > m_childChangedFilter
Definition
KisRootSurfaceTrackerBase.h:69
KisRootSurfaceTrackerBase::m_topLevelWidgetWithSurface
QPointer< QWidget > m_topLevelWidgetWithSurface
Definition
KisRootSurfaceTrackerBase.h:66
KisRootSurfaceTrackerBase::m_watchedHierarchy
QVector< QPointer< QObject > > m_watchedHierarchy
Definition
KisRootSurfaceTrackerBase.h:64
QList
Definition
KisQStringListFwd.h:16
QPointer
Definition
kis_types.h:255
libs
widgetutils
KisRootSurfaceTrackerBase.h
Generated at
2026-01-15 02:30:07+01:00
from
Krita
branch
master
, commit
38b517ca06286bb65279453cbf9a2b4fbd1153d1