19class ChildChangedEventFilter :
public QObject
23 ChildChangedEventFilter(QObject *watched, QObject *parent)
29 bool eventFilter(QObject *watched, QEvent *event)
override {
30 if (watched == m_watched &&
31 (event->type() == QEvent::ChildAdded || event->type() == QEvent::ChildRemoved)) {
37 QTimer::singleShot(0,
this, &ChildChangedEventFilter::sigChildrenChanged);
43 QObject *m_watched {
nullptr};
46 void sigChildrenChanged();
76 : QString(
"Top level surface color manager is not found!\n");
82 : QString(
"Top level surface color manager is not found!\n");
91 if (event->type() == QEvent::PlatformSurface && watched ==
m_watchedHierarchy.last().data()) {
103 QWidget *topLevel =
static_cast<QWidget *
>(newHierarchy.last().data());
113 auto disconnectExistingManager = [
this]() {
121 disconnectExistingManager();
140 &ChildChangedEventFilter::sigChildrenChanged,
151 disconnectExistingManager();
161 disconnectExistingManager();
188 wdg = wdg->parentWidget();
198 widget->removeEventFilter(
this);
204 widget->installEventFilter(
this);
210#include <KisRootSurfaceInfoProxy.moc>
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void reconnectToHierarchy(const QVector< QPointer< QObject > > newHierarchy)
QMetaObject::Connection m_surfaceManagerConnection
void tryUpdateRootSurfaceProfile()
QPointer< QObject > m_childChangedFilter
QPointer< KisSRGBSurfaceColorSpaceManager > m_topLevelSurfaceManager
const KoColorProfile * m_rootSurfaceProfile
~KisRootSurfaceInfoProxy()
void tryUpdateHierarchy()
QPointer< QWidget > m_topLevelWidgetWithSurface
QVector< QPointer< QObject > > getCurrentHierarchy(QWidget *wdg)
bool eventFilter(QObject *watched, QEvent *event) override
KisRootSurfaceInfoProxy(QWidget *watched, QObject *parent=nullptr)
QPointer< QWindow > m_topLevelNativeWindow
const KoColorProfile * rootSurfaceProfile() const
QString osPreferredColorSpaceReport() const
void tryReconnectSurfaceManager()
void sigRootSurfaceProfileChanged(const KoColorProfile *profile) const
QString colorManagementReport() const
QVector< QPointer< QObject > > m_watchedHierarchy
#define KIS_SAFE_ASSERT_RECOVER(cond)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
ChildIterator< value_type, is_const > parent(const ChildIterator< value_type, is_const > &it)
void sigDisplayConfigChanged(const KisDisplayConfig &config)
static KoColorSpaceRegistry * instance()
const KoColorProfile * p709SRGBProfile() const