KDeclarative

eventgenerator.h
1 /*
2  SPDX-FileCopyrightText: 2015 Eike Hein <[email protected]>
3  SPDX-FileCopyrightText: 2015 Marco Martin <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 
9 #ifndef EventGenerator_H
10 #define EventGenerator_H
11 
12 #include <QObject>
13 
14 class QQuickItem;
15 
16 class EventGenerator : public QObject
17 {
18  Q_OBJECT
19 
20  public:
21  enum MouseEvent {
22  MouseButtonPress,
23  MouseButtonRelease,
24  MouseMove
25  };
26  Q_ENUM(MouseEvent)
27 
28  enum GrabEvent {
29  GrabMouse,
30  UngrabMouse
31  };
32  Q_ENUM(GrabEvent)
33 
34  EventGenerator(QObject *parent = nullptr);
35  ~EventGenerator();
36 
40  Q_INVOKABLE void sendMouseEvent(QQuickItem *item, EventGenerator::MouseEvent type, int x, int y, int button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
41 
45  Q_INVOKABLE void sendMouseEventRecursive(QQuickItem *item, EventGenerator::MouseEvent type, int x, int y, int button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
46 
52  Q_INVOKABLE void sendWheelEvent(QQuickItem *item, int x, int y, const QPoint &pixelDelta, const QPoint &angleDelta, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
53 
59  Q_INVOKABLE void sendWheelEventRecursive(QQuickItem *item, int x, int y, const QPoint &pixelDelta, const QPoint &angleDelta, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
60 
64  Q_INVOKABLE void sendGrabEvent(QQuickItem *item, EventGenerator::GrabEvent type);
65 
69  Q_INVOKABLE void sendGrabEventRecursive(QQuickItem *item, EventGenerator::GrabEvent type);
70 
71  private:
72  static QList<QQuickItem *> allChildItemsRecursive(QQuickItem *parentItem);
73 };
74 
75 #endif
Q_ENUM(...)
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 22:44:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.