Krita Source Code Documentation
Loading...
Searching...
No Matches
KisScreenMigrationTracker.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KISSCREENMIGRATIONTRACKER_H
8#define KISSCREENMIGRATIONTRACKER_H
9
11
12//#include <QObject>
13//#include <QPointer>
14//#include <kritawidgetutils_export.h>
16
17
18class QScreen;
19class QWidget;
20class QWindow;
22
31class KRITAWIDGETUTILS_EXPORT KisScreenMigrationTracker : public KisRootSurfaceTrackerBase
32{
33 Q_OBJECT
34public:
35 KisScreenMigrationTracker(QWidget *trackedWidget, QObject *parent = nullptr);
36
41 QScreen* currentScreen() const;
42
48 QScreen* currentScreenSafe() const;
49
50private Q_SLOTS:
51 void slotScreenChanged(QScreen *screen);
52 void slotScreenResolutionChanged(qreal value);
53 void slotScreenLogicalResolutionChanged(qreal value);
54 void slotResolutionCompressorTriggered();
55
56Q_SIGNALS:
60 void sigScreenChanged(QScreen *screen);
61
66 void sigScreenOrResolutionChanged(QScreen *screen);
67
68private:
69 void connectScreenSignals(QScreen *screen);
70
71protected:
72 void connectToNativeWindow(QWindow *window) override;
73 void disconnectFromNativeWindow() override;
74
75private:
76 Q_DISABLE_COPY_MOVE(KisScreenMigrationTracker)
77
78 QPointer<QWindow> m_connectedTopLevelWindow;
79 QMetaObject::Connection m_topLevelWindowConnection;
80
81 KisSignalAutoConnectionsStore m_screenConnections;
82 KisSignalCompressor *m_resolutionChangeCompressor;
83};
84
85#endif // KISSCREENMIGRATIONTRACKER_H
float value(const T *src, size_t ch)
virtual void disconnectFromNativeWindow()=0
virtual void connectToNativeWindow(QWindow *nativeWindow)=0
void sigScreenChanged(QScreen *screen)
void sigScreenOrResolutionChanged(QScreen *screen)