Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwidgetwindow_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QWIDGETWINDOW_P_H
5#define QWIDGETWINDOW_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 <QtWidgets/private/qtwidgetsglobal_p.h>
19#include <QtGui/qwindow.h>
20
21#include <QtCore/private/qobject_p.h>
22#include <QtGui/private/qevent_p.h>
23#include <QtWidgets/qwidget.h>
24
25#include <QtCore/qpointer.h>
26
28
29
30class QCloseEvent;
31class QMoveEvent;
33
34class QWidgetWindow : public QWindow
35{
37 Q_DECLARE_PRIVATE(QWidgetWindow)
38public:
41
42 QWidget *widget() const { return m_widget; }
43#if QT_CONFIG(accessibility)
44 QAccessibleInterface *accessibleRoot() const override;
45#endif
46
47 QObject *focusObject() const override;
49protected:
50 bool event(QEvent *) override;
51
52 void closeEvent(QCloseEvent *) override;
53
62#if QT_CONFIG(wheelevent)
63 void handleWheelEvent(QWheelEvent *);
64#endif
65#if QT_CONFIG(draganddrop)
66 void handleDragEnterEvent(QDragEnterEvent *, QWidget *widget = nullptr);
67 void handleDragMoveEvent(QDragMoveEvent *);
68 void handleDragLeaveEvent(QDragLeaveEvent *);
69 void handleDropEvent(QDropEvent *);
70#endif
73 bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override;
74#if QT_CONFIG(tabletevent)
75 void handleTabletEvent(QTabletEvent *);
76#endif
77#ifndef QT_NO_GESTURES
79#endif
80#ifndef QT_NO_CONTEXTMENU
82#endif
83
84private slots:
85 void updateObjectName();
86
87private:
88 void handleScreenChange();
89 void handleDevicePixelRatioChange();
90 void repaintWindow();
91 bool updateSize();
92 void updateMargins();
93 void updateNormalGeometry();
94
95 enum FocusWidgets {
96 FirstFocusWidget,
97 LastFocusWidget
98 };
99 QWidget *getFocusWidget(FocusWidgets fw);
100
101 QPointer<QWidget> m_widget;
102 QPointer<QWidget> m_implicit_mouse_grabber;
103#if QT_CONFIG(draganddrop)
104 QPointer<QWidget> m_dragTarget;
105#endif
106};
107
109
110#endif // QWIDGETWINDOW_P_H
\inmodule QtCore
Definition qbytearray.h:57
The QCloseEvent class contains parameters that describe a close event.
Definition qevent.h:562
The QContextMenuEvent class contains parameters that describe a context menu event.
Definition qevent.h:594
\inmodule QtCore
Definition qcoreevent.h:45
The QExposeEvent class contains event parameters for expose events. \inmodule QtGui.
Definition qevent.h:515
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:470
The QKeyEvent class describes a key event.
Definition qevent.h:424
\inmodule QtGui
Definition qevent.h:196
The QMoveEvent class contains event parameters for move events.
Definition qevent.h:502
The QNativeGestureEvent class contains parameters that describe a gesture event. \inmodule QtGui.
\inmodule QtCore
Definition qobject.h:103
The QResizeEvent class contains event parameters for resize events.
Definition qevent.h:548
The QTouchEvent class contains parameters that describe a touch event.
Definition qevent.h:917
void setNativeWindowVisibility(bool visible)
QObject * focusObject() const override
Returns the QObject that will be the final receiver of events tied focus, such as key events.
void handleMoveEvent(QMoveEvent *)
QWidgetWindow(QWidget *widget)
void handleMouseEvent(QMouseEvent *)
void handleFocusInEvent(QFocusEvent *)
void handleResizeEvent(QResizeEvent *)
void handleEnterLeaveEvent(QEvent *)
void handleTouchEvent(QTouchEvent *)
void handleKeyEvent(QKeyEvent *)
void handleContextMenuEvent(QContextMenuEvent *)
bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override
Override this to handle platform dependent events.
void handleExposeEvent(QExposeEvent *)
void closeEvent(QCloseEvent *) override
Override this to handle close events (ev).
void handleNonClientAreaMouseEvent(QMouseEvent *)
void handleGestureEvent(QNativeGestureEvent *)
void handleWindowStateChangedEvent(QWindowStateChangeEvent *event)
QWidget * widget() const
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
\inmodule QtGui
Definition qevent.h:899
\inmodule QtGui
Definition qwindow.h:63
virtual QAccessibleInterface * accessibleRoot() const
Returns the accessibility interface for the object that the window represents.
Definition qwindow.cpp:2222
bool visible
whether the window is visible or not
Definition qwindow.h:90
Combined button and popup list for selecting options.
GLuint GLsizei const GLchar * message
struct _cl_event * event
GLuint64EXT * result
[6]
#define Q_OBJECT
#define slots
ptrdiff_t qintptr
Definition qtypes.h:166