1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKPOPUPWINDOW_P_P_H
5#define QQUICKPOPUPWINDOW_P_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick/private/qquickwindowmodule_p.h>
19#include <QtQuickTemplates2/private/qtquicktemplates2global_p.h>
20
21QT_BEGIN_NAMESPACE
22
23class QQuickPopup;
24class QQuickPopupWindowPrivate;
25
26class Q_QUICKTEMPLATES2_EXPORT QQuickPopupWindow : public QQuickWindowQmlImpl
27{
28 Q_OBJECT
29 QML_ANONYMOUS
30
31public:
32 explicit QQuickPopupWindow(QQuickPopup *popup, QWindow *parent = nullptr);
33 QQuickPopup *popup() const;
34
35protected:
36 void hideEvent(QHideEvent *e) override;
37 void moveEvent(QMoveEvent *e) override;
38 void resizeEvent(QResizeEvent *e) override;
39 bool event(QEvent *e) override;
40
41private:
42 void windowChanged(QWindow *window);
43 std::optional<QPoint> global2Local(const QPoint &pos) const;
44 void parentWindowXChanged(int newX);
45 void parentWindowYChanged(int newY);
46 void handlePopupPositionChangeFromWindowSystem(const QPoint &pos);
47 void implicitWidthChanged();
48 void implicitHeightChanged();
49
50 Q_DISABLE_COPY(QQuickPopupWindow)
51 Q_DECLARE_PRIVATE(QQuickPopupWindow)
52};
53
54QT_END_NAMESPACE
55
56#endif // QQUICKPOPUPWINDOW_P_P_H
57

source code of qtdeclarative/src/quicktemplates/qquickpopupwindow_p_p.h