Qt 6.x
The Qt SDK
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
26
27
28class QCloseEvent;
29class QMoveEvent;
31
32class QWidgetWindow : public QWindow
33{
35 Q_DECLARE_PRIVATE(QWidgetWindow)
36public:
39
40 QWidget *widget() const { return m_widget; }
41#if QT_CONFIG(accessibility)
42 QAccessibleInterface *accessibleRoot() const override;
43#endif
44
45 QObject *focusObject() const override;
47protected:
48 bool event(QEvent *) override;
49
50 void closeEvent(QCloseEvent *) override;
51
60#if QT_CONFIG(wheelevent)
61 void handleWheelEvent(QWheelEvent *);
62#endif
63#if QT_CONFIG(draganddrop)
64 void handleDragEnterEvent(QDragEnterEvent *, QWidget *widget = nullptr);
65 void handleDragMoveEvent(QDragMoveEvent *);
66 void handleDragLeaveEvent(QDragLeaveEvent *);
67 void handleDropEvent(QDropEvent *);
68#endif
71 bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override;
72#if QT_CONFIG(tabletevent)
73 void handleTabletEvent(QTabletEvent *);
74#endif
75#ifndef QT_NO_GESTURES
77#endif
78#ifndef QT_NO_CONTEXTMENU
80#endif
81
82private slots:
83 void updateObjectName();
84
85private:
86 void handleScreenChange();
87 void handleDevicePixelRatioChange();
88 void repaintWindow();
89 bool updateSize();
90 void updateMargins();
91 void updateNormalGeometry();
92
93 enum FocusWidgets {
94 FirstFocusWidget,
95 LastFocusWidget
96 };
97 QWidget *getFocusWidget(FocusWidgets fw);
98
99 QPointer<QWidget> m_widget;
100 QPointer<QWidget> m_implicit_mouse_grabber;
101#if QT_CONFIG(draganddrop)
102 QPointer<QWidget> m_dragTarget;
103#endif
104};
105
107
108#endif // QWIDGETWINDOW_P_H
\inmodule QtCore
Definition qbytearray.h:57
The QCloseEvent class contains parameters that describe a close event.
Definition qevent.h:561
The QContextMenuEvent class contains parameters that describe a context menu event.
Definition qevent.h:593
\inmodule QtCore
Definition qcoreevent.h:45
The QExposeEvent class contains event parameters for expose events. \inmodule QtGui.
Definition qevent.h:514
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:469
The QKeyEvent class describes a key event.
Definition qevent.h:423
\inmodule QtGui
Definition qevent.h:195
The QMoveEvent class contains event parameters for move events.
Definition qevent.h:501
The QNativeGestureEvent class contains parameters that describe a gesture event. \inmodule QtGui.
\inmodule QtCore
Definition qobject.h:90
\inmodule QtCore
Definition qpointer.h:18
The QResizeEvent class contains event parameters for resize events.
Definition qevent.h:547
The QTouchEvent class contains parameters that describe a touch event.
Definition qevent.h:916
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 *)
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:898
\inmodule QtGui
Definition qwindow.h:63
virtual QAccessibleInterface * accessibleRoot() const
Returns the accessibility interface for the object that the window represents.
Definition qwindow.cpp:2150
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:71