QtBase  v6.3.1
qevent_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2020 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://www.qt.io/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 3 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 3 requirements
23 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24 **
25 ** GNU General Public License Usage
26 ** Alternatively, this file may be used under the terms of the GNU
27 ** General Public License version 2.0 or (at your option) the GNU General
28 ** Public license version 3 or any later version approved by the KDE Free
29 ** Qt Foundation. The licenses are as published by the Free Software
30 ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31 ** included in the packaging of this file. Please review the following
32 ** information to ensure the GNU General Public License requirements will
33 ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34 ** https://www.gnu.org/licenses/gpl-3.0.html.
35 **
36 ** $QT_END_LICENSE$
37 **
38 ****************************************************************************/
39 
40 #ifndef QEVENT_P_H
41 #define QEVENT_P_H
42 
43 //
44 // W A R N I N G
45 // -------------
46 //
47 // This file is not part of the Qt API. It exists for the convenience
48 // of other Qt classes. This header file may change from version to
49 // version without notice, or even be removed.
50 //
51 // We mean it.
52 //
53 
54 #include <QtGui/private/qtguiglobal_p.h>
55 #include <QtCore/qurl.h>
56 #include <QtGui/qevent.h>
57 #include <QtGui/qwindow.h>
58 
60 
61 class QPointingDevice;
62 
63 class Q_GUI_EXPORT QMutableTouchEvent : public QTouchEvent
64 {
65 public:
67  const QPointingDevice *device = nullptr,
68  Qt::KeyboardModifiers modifiers = Qt::NoModifier,
69  const QList<QEventPoint> &touchPoints = QList<QEventPoint>()) :
70  QTouchEvent(eventType, device, modifiers, touchPoints) { }
71  ~QMutableTouchEvent() override;
72 
73  static QMutableTouchEvent *from(QTouchEvent *e) { return static_cast<QMutableTouchEvent *>(e); }
74 
75  static QMutableTouchEvent &from(QTouchEvent &e) { return static_cast<QMutableTouchEvent &>(e); }
76 
77  void setTarget(QObject *target) { m_target = target; }
78 
79  void addPoint(const QEventPoint &point);
80 };
81 
82 class Q_GUI_EXPORT QMutableSinglePointEvent : public QSinglePointEvent
83 {
84 public:
87  Qt::MouseButton button = Qt::NoButton, Qt::MouseButtons buttons = Qt::NoButton,
88  Qt::KeyboardModifiers modifiers = Qt::NoModifier,
90  QSinglePointEvent(type, device, point, button, buttons, modifiers, source) { }
92 
94 
96 
97  void setSource(Qt::MouseEventSource s) { m_source = s; }
98 
99  bool isDoubleClick() { return m_doubleClick; }
100 
101  void setDoubleClick(bool d = true) { m_doubleClick = d; }
102 };
103 
105 
106 #endif // QEVENT_P_H
@ None
Definition: qcoreevent.h:71
@ TouchBegin
Definition: qcoreevent.h:254
The QEventPoint class provides information about a point in a QPointerEvent.
Definition: qeventpoint.h:56
void setSource(Qt::MouseEventSource s)
Definition: qevent_p.h:97
static QMutableSinglePointEvent & from(QSinglePointEvent &e)
Definition: qevent_p.h:95
QMutableSinglePointEvent(Type type=QEvent::None, const QPointingDevice *device=nullptr, const QEventPoint &point=QEventPoint(), Qt::MouseButton button=Qt::NoButton, Qt::MouseButtons buttons=Qt::NoButton, Qt::KeyboardModifiers modifiers=Qt::NoModifier, Qt::MouseEventSource source=Qt::MouseEventSynthesizedByQt)
Definition: qevent_p.h:86
QMutableSinglePointEvent(const QSinglePointEvent &other)
Definition: qevent_p.h:85
~QMutableSinglePointEvent() override
static QMutableSinglePointEvent * from(QSinglePointEvent *e)
Definition: qevent_p.h:93
void setDoubleClick(bool d=true)
Definition: qevent_p.h:101
~QMutableTouchEvent() override
QMutableTouchEvent(QEvent::Type eventType=QEvent::TouchBegin, const QPointingDevice *device=nullptr, Qt::KeyboardModifiers modifiers=Qt::NoModifier, const QList< QEventPoint > &touchPoints=QList< QEventPoint >())
Definition: qevent_p.h:66
void setTarget(QObject *target)
Definition: qevent_p.h:77
static QMutableTouchEvent & from(QTouchEvent &e)
Definition: qevent_p.h:75
static QMutableTouchEvent * from(QTouchEvent *e)
Definition: qevent_p.h:73
The QObject class is the base class of all Qt objects.
Definition: qobject.h:125
The QPointingDevice class describes a device from which mouse, touch or tablet events originate.
A base class for pointer events containing a single point, such as mouse events.
Definition: qevent.h:140
The QTouchEvent class contains parameters that describe a touch event.
Definition: qevent.h:1020
QObject * target() const
Definition: qevent.h:1041
QPushButton * button
[2]
double e
MouseButton
Definition: qnamespace.h:81
@ NoButton
Definition: qnamespace.h:82
MouseEventSource
Definition: qnamespace.h:1703
@ MouseEventSynthesizedByQt
Definition: qnamespace.h:1706
@ NoModifier
Definition: qnamespace.h:1074
GLenum type
Definition: qopengl.h:270
GLenum target
GLsizei GLsizei GLchar * source
GLdouble s
[6]
Definition: qopenglext.h:235
QSharedPointer< T > other(t)
[5]
Definition: moc.h:48