Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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// Qt-Security score:significant reason:default
4
5#ifndef QWIDGETWINDOW_P_H
6#define QWIDGETWINDOW_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtWidgets/private/qtwidgetsglobal_p.h>
20#include <QtGui/qwindow.h>
21
22#include <QtCore/private/qobject_p.h>
23#include <QtGui/private/qevent_p.h>
24#include <QtWidgets/qwidget.h>
25
26#include <QtCore/qpointer.h>
27
29
30
31class QCloseEvent;
32class QMoveEvent;
34
35class QWidgetWindow : public QWindow
36{
37 Q_OBJECT
38 Q_DECLARE_PRIVATE(QWidgetWindow)
39public:
42
43 QWidget *widget() const { return m_widget; }
44#if QT_CONFIG(accessibility)
46#endif
47
48 QObject *focusObject() const override;
49 void setNativeWindowVisibility(bool visible);
50 static void focusNextPrevChild(QWidget *widget, bool next);
51
52protected:
53 bool event(QEvent *) override;
54
55 void closeEvent(QCloseEvent *) override;
56
57 void handleEnterLeaveEvent(QEvent *);
58 void handleFocusInEvent(QFocusEvent *);
59 void handleKeyEvent(QKeyEvent *);
60 void handleMouseEvent(QMouseEvent *);
61 void handleNonClientAreaMouseEvent(QMouseEvent *);
62 void handleTouchEvent(QTouchEvent *);
63 void handleMoveEvent(QMoveEvent *);
64 void handleResizeEvent(QResizeEvent *);
65#if QT_CONFIG(wheelevent)
67#endif
68#if QT_CONFIG(draganddrop)
73#endif
74 void handleExposeEvent(QExposeEvent *);
75 void handleWindowStateChangedEvent(QWindowStateChangeEvent *event);
76 bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override;
77#if QT_CONFIG(tabletevent)
79#endif
80#ifndef QT_NO_GESTURES
81 void handleGestureEvent(QNativeGestureEvent *);
82#endif
83#ifndef QT_NO_CONTEXTMENU
84 void handleContextMenuEvent(QContextMenuEvent *);
85#endif
86
87private slots:
88 void updateObjectName();
89
90private:
91 void handleScreenChange();
92 void handleDevicePixelRatioChange();
93 void scheduleRepaint();
94 bool updateSize();
95 void updateMargins();
96 void updateNormalGeometry();
97
98 enum FocusWidgets {
99 FirstFocusWidget,
100 LastFocusWidget
101 };
102 QWidget *getFocusWidget(FocusWidgets fw);
103
104 QPointer<QWidget> m_widget;
105 QPointer<QWidget> m_implicit_mouse_grabber;
106#if QT_CONFIG(draganddrop)
108#endif
109};
110
111QT_END_NAMESPACE
112
113#endif // QWIDGETWINDOW_P_H
friend class QWidget
Definition qpainter.h:431
The QStyleFactory class creates QStyle objects.
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 *)
static void focusNextPrevChild(QWidget *widget, bool next)
void handleKeyEvent(QKeyEvent *)
void handleContextMenuEvent(QContextMenuEvent *)
bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override
Override this to handle platform dependent events.
bool event(QEvent *) override
Override this to handle any event (ev) sent to the window.
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
Q_GLOBAL_STATIC(DefaultRoleNames, qDefaultRoleNames, { { Qt::DisplayRole, "display" }, { Qt::DecorationRole, "decoration" }, { Qt::EditRole, "edit" }, { Qt::ToolTipRole, "toolTip" }, { Qt::StatusTipRole, "statusTip" }, { Qt::WhatsThisRole, "whatsThis" }, }) const QHash< int
Q_STATIC_LOGGING_CATEGORY(lcAccessibilityCore, "qt.accessibility.core")
static int uiEffectToFlag(Qt::UIEffect effect)
static void initResources()
void qt_init_tooltip_palette()
static void ungrabMouseForPopup(QWidget *popup)
static void ungrabKeyboardForPopup(QWidget *popup)
Q_TRACE_POINT(qtwidgets, QApplication_notify_entry, QObject *receiver, QEvent *event, QEvent::Type type)
Q_WIDGETS_EXPORT bool qt_tryModalHelper(QWidget *widget, QWidget **rettop)
int qt_antialiasing_threshold
bool qt_in_tab_key_event
static bool popupGrabOk
void qRegisterWidgetsVariant()
static void grabForPopup(QWidget *popup)
QWidget * qt_tlw_for_window(QWindow *wnd)
Q_GUI_EXPORT bool qt_sendShortcutOverrideEvent(QObject *o, ulong timestamp, int k, Qt::KeyboardModifiers mods, const QString &text=QString(), bool autorep=false, ushort count=1)
bool qt_try_modal(QWidget *widget, QEvent::Type type)
Q_TRACE_POINT(qtcore, QCoreApplication_notify_exit, bool consumed, bool filtered)
Q_TRACE_METADATA(qtcore, "ENUM { AUTO, RANGE User ... MaxUser } QEvent::Type;")
Q_TRACE_PREFIX(qtcore, "#include <qcoreevent.h>")
#define qApp
Q_CORE_EXPORT void qt_call_post_routines()
#define CHECK_QAPP_INSTANCE(...)
bool qt_sendSpontaneousEvent(QObject *, QEvent *)
#define QWIDGETSIZE_MAX
Definition qwidget.h:922
QPointer< QWindow > qt_last_mouse_receiver