|
Krita Source Code Documentation
|
#include <KisRootSurfaceTrackerBase.h>
Inheritance diagram for KisRootSurfaceTrackerBase:Public Types | |
| enum | UpdateHierarchyFlag { None = 0x0 , AllowDeadParents = 0x1 } |
Public Member Functions | |
| KisRootSurfaceTrackerBase (QWidget *watched, QObject *parent=nullptr) | |
| Q_DECLARE_FLAGS (UpdateHierarchyFlags, UpdateHierarchyFlag) | |
| QWidget * | trackedWidget () const |
| ~KisRootSurfaceTrackerBase () | |
Protected Member Functions | |
| virtual void | connectToNativeWindow (QWindow *nativeWindow)=0 |
| virtual void | disconnectFromNativeWindow ()=0 |
| void | initialize () |
Private Member Functions | |
| bool | eventFilter (QObject *watched, QEvent *event) override |
| QVector< QPointer< QObject > > | getCurrentHierarchy (QWidget *wdg) |
| void | reconnectToHierarchy (const QVector< QPointer< QObject > > newHierarchy, bool allowDeadParents) |
| void | tryReconnectToNativeWindow () |
| void | tryUpdateHierarchy (UpdateHierarchyFlags flags=None) |
Private Attributes | |
| QPointer< QObject > | m_childChangedFilter |
| QPointer< QWindow > | m_topLevelNativeWindow |
| QPointer< QWidget > | m_topLevelWidgetWithSurface |
| QWidget * | m_watched {nullptr} |
| QVector< QPointer< QObject > > | m_watchedHierarchy |
KisRootSurfaceProxyBase is a special proxy object for toplevel native window attached to the current QWidget
When created, the proxy does the following:
1) Finds the top-level widget that watched belongs to. (is watched changed its parent in the meantime, e.g. during construction, then the proxy will handle that as well)
2) Finds the QWindow that this toplevel widget is painted on (if platform window is not created yet, subscribes to QPlatformSurfaceEvent to attach when platform window is finally created)
3) When found, calls implementation of connectToNativeWindow() that would connect to the actual native window
Definition at line 37 of file KisRootSurfaceTrackerBase.h.
| Enumerator | |
|---|---|
| None | |
| AllowDeadParents | |
Definition at line 41 of file KisRootSurfaceTrackerBase.h.
| KisRootSurfaceTrackerBase::KisRootSurfaceTrackerBase | ( | QWidget * | watched, |
| QObject * | parent = nullptr ) |
Definition at line 50 of file KisRootSurfaceTrackerBase.cpp.
| KisRootSurfaceTrackerBase::~KisRootSurfaceTrackerBase | ( | ) |
Definition at line 56 of file KisRootSurfaceTrackerBase.cpp.
|
protectedpure virtual |
Implemented in KisRootSurfaceInfoProxy, and KisScreenMigrationTracker.
|
protectedpure virtual |
Implemented in KisRootSurfaceInfoProxy, and KisScreenMigrationTracker.
|
overrideprivate |
Definition at line 70 of file KisRootSurfaceTrackerBase.cpp.
References AllowDeadParents, m_watchedHierarchy, tryReconnectToNativeWindow(), and tryUpdateHierarchy().
|
private |
Definition at line 138 of file KisRootSurfaceTrackerBase.cpp.
|
protected |
Definition at line 65 of file KisRootSurfaceTrackerBase.cpp.
References tryUpdateHierarchy().
| KisRootSurfaceTrackerBase::Q_DECLARE_FLAGS | ( | UpdateHierarchyFlags | , |
| UpdateHierarchyFlag | ) |
|
private |
When a parent of a widget is changed, some of its early parents may already be dead when we receive a ParentChange event.
Definition at line 156 of file KisRootSurfaceTrackerBase.cpp.
References KIS_SAFE_ASSERT_RECOVER, and m_watchedHierarchy.
| QWidget * KisRootSurfaceTrackerBase::trackedWidget | ( | ) | const |
Definition at line 60 of file KisRootSurfaceTrackerBase.cpp.
References m_watched.
|
private |
Definition at line 102 of file KisRootSurfaceTrackerBase.cpp.
References connectToNativeWindow(), disconnectFromNativeWindow(), m_childChangedFilter, m_topLevelNativeWindow, m_topLevelWidgetWithSurface, and tryReconnectToNativeWindow().
Definition at line 89 of file KisRootSurfaceTrackerBase.cpp.
References AllowDeadParents, getCurrentHierarchy(), m_topLevelWidgetWithSurface, m_watched, m_watchedHierarchy, reconnectToHierarchy(), and tryReconnectToNativeWindow().
|
private |
Definition at line 76 of file KisRootSurfaceTrackerBase.h.
|
private |
Definition at line 75 of file KisRootSurfaceTrackerBase.h.
|
private |
Definition at line 73 of file KisRootSurfaceTrackerBase.h.
|
private |
Definition at line 70 of file KisRootSurfaceTrackerBase.h.
Definition at line 71 of file KisRootSurfaceTrackerBase.h.