2017-12-15 15:42:36 +00:00
|
|
|
#ifndef POPUPWINDOWTRACKER_HXX
|
|
|
|
#define POPUPWINDOWTRACKER_HXX
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
class QWindow;
|
|
|
|
|
|
|
|
class PopupWindowTracker : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
Q_PROPERTY(QWindow* window READ window WRITE setWindow NOTIFY windowChanged)
|
|
|
|
QWindow* m_window = nullptr;
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit PopupWindowTracker(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
~PopupWindowTracker();
|
|
|
|
|
|
|
|
QWindow* window() const
|
|
|
|
{
|
|
|
|
return m_window;
|
|
|
|
}
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
void windowChanged(QWindow* window);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void setWindow(QWindow* window);
|
|
|
|
|
2018-03-09 10:07:14 +00:00
|
|
|
void onApplicationStateChanged(Qt::ApplicationState as);
|
|
|
|
|
2017-12-15 15:42:36 +00:00
|
|
|
protected:
|
|
|
|
bool eventFilter(QObject *watched, QEvent *event) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // POPUPWINDOWTRACKER_HXX
|