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
qflickgesture.cpp
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#include "qgesture.h"
5#include "qapplication.h"
6#include "qevent.h"
7#include "qwidget.h"
8#if QT_CONFIG(graphicsview)
9#include "qgraphicsitem.h"
10#include "qgraphicsscene.h"
11#include "qgraphicssceneevent.h"
12#include "qgraphicsview.h"
13#endif
14#include "qscroller.h"
15#include <QtGui/qpointingdevice.h>
16#include "private/qapplication_p.h"
17#include "private/qevent_p.h"
18#include "private/qflickgesture_p.h"
19#include "qdebug.h"
20
21#ifndef QT_NO_GESTURES
22
24
25//#define QFLICKGESTURE_DEBUG
26
27#ifdef QFLICKGESTURE_DEBUG
28# define qFGDebug qDebug
29#else
30# define qFGDebug while (false) qDebug
31#endif
32
34
36{
37 switch (e->type()) {
40 case QEvent::MouseMove: {
41 return static_cast<QMouseEvent *>(e->clone());
42 }
43#if QT_CONFIG(graphicsview)
50 QMouseEvent *cme = new QMouseEvent(met, QPoint(0, 0), QPoint(0, 0), me->screenPos(),
51 me->button(), me->buttons(), me->modifiers(), me->source());
52 cme->setTimestamp(me->timestamp());
53 return cme;
54 }
55#endif // QT_CONFIG(graphicsview)
56 default:
57 return nullptr;
58 }
59}
60
62{
63private:
66 , pressDelayTimer(0)
67 , sendingEvent(false)
68 , mouseButton(Qt::NoButton)
69 , mouseTarget(nullptr)
70 , mouseEventSource(Qt::MouseEventNotSynthesized)
71 { }
72
73public:
74 enum {
77 };
78
80 {
81 static PressDelayHandler *inst = nullptr;
82 if (!inst)
84 return inst;
85 }
86
88 {
89 return sendingEvent;
90 }
91
92 bool isDelaying() const
93 {
94 return !pressDelayEvent.isNull();
95 }
96
97 void pressed(QEvent *e, int delay)
98 {
99 if (!pressDelayEvent) {
100 pressDelayEvent.reset(copyMouseEvent(e));
101 pressDelayTimer = startTimer(delay);
102 mouseTarget = QApplication::widgetAt(pressDelayEvent->globalPosition().toPoint());
103 mouseButton = pressDelayEvent->button();
104 mouseEventSource = pressDelayEvent->source();
105 qFGDebug("QFG: consuming/delaying mouse press");
106 } else {
107 qFGDebug("QFG: NOT consuming/delaying mouse press");
108 }
109 e->setAccepted(true);
110 }
111
112 bool released(QEvent *e, bool scrollerWasActive, bool scrollerIsActive)
113 {
114 // consume this event if the scroller was or is active
115 bool result = scrollerWasActive || scrollerIsActive;
116
117 // stop the timer
118 if (pressDelayTimer) {
119 killTimer(pressDelayTimer);
120 pressDelayTimer = 0;
121 }
122 // we still haven't even sent the press, so do it now
123 if (pressDelayEvent && mouseTarget && !scrollerIsActive) {
124 QScopedPointer<QMouseEvent> releaseEvent(copyMouseEvent(e));
125
126 qFGDebug() << "QFG: re-sending mouse press (due to release) for " << mouseTarget;
127 sendMouseEvent(pressDelayEvent.data(), UngrabMouseBefore);
128
129 qFGDebug() << "QFG: faking mouse release (due to release) for " << mouseTarget;
130 sendMouseEvent(releaseEvent.data());
131
132 result = true; // consume this event
133 } else if (mouseTarget && scrollerIsActive) {
134 // we grabbed the mouse explicitly when the scroller became active, so undo that now
136 }
137 pressDelayEvent.reset(nullptr);
138 mouseTarget = nullptr;
139 return result;
140 }
141
143 {
144 qFGDebug("QFG: deleting delayed mouse press, since scroller was only intercepted");
145 if (pressDelayEvent) {
146 // we still haven't even sent the press, so just throw it away now
147 if (pressDelayTimer) {
148 killTimer(pressDelayTimer);
149 pressDelayTimer = 0;
150 }
151 pressDelayEvent.reset(nullptr);
152 }
153 mouseTarget = nullptr;
154 }
155
156 void scrollerBecameActive(Qt::KeyboardModifiers eventModifiers, Qt::MouseButtons eventButtons)
157 {
158 if (pressDelayEvent) {
159 // we still haven't even sent the press, so just throw it away now
160 qFGDebug("QFG: deleting delayed mouse press, since scroller is active now");
161 if (pressDelayTimer) {
162 killTimer(pressDelayTimer);
163 pressDelayTimer = 0;
164 }
165 pressDelayEvent.reset(nullptr);
166 mouseTarget = nullptr;
167 } else if (mouseTarget) {
168 // we did send a press, so we need to fake a release now
170
171 qFGDebug() << "QFG: sending a fake mouse release at far-far-away to " << mouseTarget;
172 QMouseEvent re(QEvent::MouseButtonRelease, QPoint(), farFarAway, farFarAway,
173 mouseButton, eventButtons & ~mouseButton,
174 eventModifiers, mouseEventSource);
176 // don't clear the mouseTarget just yet, since we need to explicitly ungrab the mouse on release!
177 }
178 }
179
180protected:
181 void timerEvent(QTimerEvent *e) override
182 {
183 if (e->timerId() == pressDelayTimer) {
184 if (pressDelayEvent && mouseTarget) {
185 qFGDebug() << "QFG: timer event: re-sending mouse press to " << mouseTarget;
186 sendMouseEvent(pressDelayEvent.data(), UngrabMouseBefore);
187 }
188 pressDelayEvent.reset(nullptr);
189
190 if (pressDelayTimer) {
191 killTimer(pressDelayTimer);
192 pressDelayTimer = 0;
193 }
194 }
195 }
196
198 {
199 if (mouseTarget) {
200 sendingEvent = true;
201
202#if QT_CONFIG(graphicsview)
203 QGraphicsItem *grabber = nullptr;
204 if (mouseTarget->parentWidget()) {
205 if (QGraphicsView *gv = qobject_cast<QGraphicsView *>(mouseTarget->parentWidget())) {
206 if (gv->scene())
207 grabber = gv->scene()->mouseGrabberItem();
208 }
209 }
210
211 if (grabber && (flags & UngrabMouseBefore)) {
212 // GraphicsView Mouse Handling Workaround #1:
213 // we need to ungrab the mouse before re-sending the press,
214 // since the scene had already set the mouse grabber to the
215 // original (and consumed) event's receiver
216 qFGDebug() << "QFG: ungrabbing" << grabber;
217 grabber->ungrabMouse();
218 }
219#else
221#endif // QT_CONFIG(graphicsview)
222
223 if (me) {
224 QMouseEvent copy(me->type(), mouseTarget->mapFromGlobal(me->globalPosition()),
225 mouseTarget->topLevelWidget()->mapFromGlobal(me->globalPosition()), me->globalPosition(),
226 me->button(), me->buttons(), me->modifiers(),
227 me->source(), me->pointingDevice());
228 copy.setTimestamp(me->timestamp());
229 qt_sendSpontaneousEvent(mouseTarget, &copy);
230 }
231
232#if QT_CONFIG(graphicsview)
233 if (grabber && (flags & RegrabMouseAfterwards)) {
234 // GraphicsView Mouse Handling Workaround #2:
235 // we need to re-grab the mouse after sending a faked mouse
236 // release, since we still need the mouse moves for the gesture
237 // (the scene will clear the item's mouse grabber status on
238 // release).
239 qFGDebug() << "QFG: re-grabbing" << grabber;
240 grabber->grabMouse();
241 }
242#endif
243 sendingEvent = false;
244 }
245 }
246
247
248private:
249 int pressDelayTimer;
250 QScopedPointer<QMouseEvent> pressDelayEvent;
251 bool sendingEvent;
252 Qt::MouseButton mouseButton;
253 QPointer<QWidget> mouseTarget;
254 Qt::MouseEventSource mouseEventSource;
255};
256
257
275 : QGesture(*new QFlickGesturePrivate, parent)
276{
277 d_func()->q_ptr = this;
278 d_func()->receiver = receiver;
279 d_func()->receiverScroller = (receiver && QScroller::hasScroller(receiver)) ? QScroller::scroller(receiver) : nullptr;
280 d_func()->button = button;
281}
282
285
287 : receiverScroller(nullptr), button(Qt::NoButton), macIgnoreWheel(false)
288{ }
289
290
291//
292// QFlickGestureRecognizer
293//
294
295
300
304{
305#if QT_CONFIG(graphicsview)
306 QGraphicsObject *go = qobject_cast<QGraphicsObject*>(target);
307 if (go && button == Qt::NoButton) {
308 go->setAcceptTouchEvents(true);
309 }
310#endif
311 return new QFlickGesture(target, button);
312}
313
322 QObject *watched,
323 QEvent *event)
324{
325 Q_UNUSED(watched);
326
327 Q_CONSTINIT static QElapsedTimer monotonicTimer;
328 if (!monotonicTimer.isValid())
329 monotonicTimer.start();
330
331 QFlickGesture *q = static_cast<QFlickGesture *>(state);
332 QFlickGesturePrivate *d = q->d_func();
333
334 QScroller *scroller = d->receiverScroller;
335 if (!scroller)
336 return Ignore; // nothing to do without a scroller?
337
338 QWidget *receiverWidget = qobject_cast<QWidget *>(d->receiver);
339#if QT_CONFIG(graphicsview)
340 QGraphicsObject *receiverGraphicsObject = qobject_cast<QGraphicsObject *>(d->receiver);
341#endif
342
343 // this is only set for events that we inject into the event loop via sendEvent()
344 if (PressDelayHandler::instance()->shouldEventBeIgnored(event)) {
345 //qFGDebug() << state << "QFG: ignored event: " << event->type();
346 return Ignore;
347 }
348
349 const QMouseEvent *me = nullptr;
350#if QT_CONFIG(graphicsview)
351 const QGraphicsSceneMouseEvent *gsme = nullptr;
352#endif
353 const QTouchEvent *te = nullptr;
354 QPoint globalPos;
355
356 // qFGDebug() << "FlickGesture "<<state<<"watched:"<<watched<<"receiver"<<d->receiver<<"event"<<event->type()<<"button"<<button;
357
358 Qt::KeyboardModifiers keyboardModifiers = Qt::NoModifier;
359 Qt::MouseButtons mouseButtons = Qt::NoButton;
360 switch (event->type()) {
364 if (!receiverWidget)
365 return Ignore;
366 if (button != Qt::NoButton) {
367 me = static_cast<const QMouseEvent *>(event);
368 keyboardModifiers = me->modifiers();
369 mouseButtons = me->buttons();
370 globalPos = me->globalPosition().toPoint();
371 }
372 break;
373#if QT_CONFIG(graphicsview)
377 if (!receiverGraphicsObject)
378 return Ignore;
379 if (button != Qt::NoButton) {
380 gsme = static_cast<const QGraphicsSceneMouseEvent *>(event);
381 keyboardModifiers = gsme->modifiers();
382 mouseButtons = gsme->buttons();
383 globalPos = gsme->screenPos();
384 }
385 break;
386#endif
388 case QEvent::TouchEnd:
390 if (button == Qt::NoButton) {
391 te = static_cast<const QTouchEvent *>(event);
392 keyboardModifiers = te->modifiers();
393 if (!te->points().isEmpty())
394 globalPos = te->points().at(0).globalPosition().toPoint();
395 }
396 break;
397
398 // consume all wheel events if the scroller is active
399 case QEvent::Wheel:
400 if (d->macIgnoreWheel || (scroller->state() != QScroller::Inactive))
401 return Ignore | ConsumeEventHint;
402 break;
403
404 // consume all dbl click events if the scroller is active
407 return Ignore | ConsumeEventHint;
408 break;
409
410 default:
411 break;
412 }
413
414 if (!me
415#if QT_CONFIG(graphicsview)
416 && !gsme
417#endif
418 && !te) // Neither mouse nor touch
419 return Ignore;
420
421 // get the current pointer position in local coordinates.
422 QPointF point;
423 QScroller::Input inputType = (QScroller::Input) 0;
424
425 switch (event->type()) {
427 if (me && me->button() == button && me->buttons() == button) {
428 point = me->globalPosition().toPoint();
429 inputType = QScroller::InputPress;
430 } else if (me) {
431 scroller->stop();
432 return CancelGesture;
433 }
434 break;
436 if (me && me->button() == button) {
437 point = me->globalPosition().toPoint();
438 inputType = QScroller::InputRelease;
439 }
440 break;
442 if (me && me->buttons() == button) {
443 point = me->globalPosition().toPoint();
444 inputType = QScroller::InputMove;
445 }
446 break;
447
448#if QT_CONFIG(graphicsview)
450 if (gsme && gsme->button() == button && gsme->buttons() == button) {
451 point = gsme->scenePos();
452 inputType = QScroller::InputPress;
453 } else if (gsme) {
454 scroller->stop();
455 return CancelGesture;
456 }
457 break;
459 if (gsme && gsme->button() == button) {
460 point = gsme->scenePos();
461 inputType = QScroller::InputRelease;
462 }
463 break;
465 if (gsme && gsme->buttons() == button) {
466 point = gsme->scenePos();
467 inputType = QScroller::InputMove;
468 }
469 break;
470#endif
471
473 inputType = QScroller::InputPress;
475 case QEvent::TouchEnd:
476 if (!inputType)
477 inputType = QScroller::InputRelease;
480 if (!inputType)
481 inputType = QScroller::InputMove;
482
483 if (te->pointingDevice()->type() == QInputDevice::DeviceType::TouchPad) {
484 if (te->points().size() != 2) // 2 fingers on pad
485 return Ignore;
486
487 point = te->points().at(0).scenePressPosition() +
488 ((te->points().at(0).scenePosition() - te->points().at(0).scenePressPosition()) +
489 (te->points().at(1).scenePosition() - te->points().at(1).scenePressPosition())) / 2;
490 } else { // TouchScreen
491 if (te->points().size() != 1) // 1 finger on screen
492 return Ignore;
493
494 point = te->points().at(0).scenePosition();
495 }
496 break;
497
498 default:
499 break;
500 }
501
502 // Check for an active scroller at globalPos
503 if (inputType == QScroller::InputPress) {
504 const auto activeScrollers = QScroller::activeScrollers();
505 for (QScroller *as : activeScrollers) {
506 if (as != scroller) {
507 QRegion scrollerRegion;
508
509 if (QWidget *w = qobject_cast<QWidget *>(as->target())) {
510 scrollerRegion = QRect(w->mapToGlobal(QPoint(0, 0)), w->size());
511#if QT_CONFIG(graphicsview)
512 } else if (QGraphicsObject *go = qobject_cast<QGraphicsObject *>(as->target())) {
513 if (const auto *scene = go->scene()) {
514 const auto goBoundingRectMappedToScene = go->mapToScene(go->boundingRect());
515 const auto views = scene->views();
516 for (QGraphicsView *gv : views) {
517 scrollerRegion |= gv->mapFromScene(goBoundingRectMappedToScene)
518 .translated(gv->mapToGlobal(QPoint(0, 0)));
519 }
520 }
521#endif
522 }
523 // active scrollers always have priority
524 if (scrollerRegion.contains(globalPos))
525 return Ignore;
526 }
527 }
528 }
529
530 bool scrollerWasDragging = (scroller->state() == QScroller::Dragging);
531 bool scrollerWasScrolling = (scroller->state() == QScroller::Scrolling);
532
533 if (inputType) {
534 if (QWidget *w = qobject_cast<QWidget *>(d->receiver))
535 point = w->mapFromGlobal(point.toPoint());
536#if QT_CONFIG(graphicsview)
537 else if (QGraphicsObject *go = qobject_cast<QGraphicsObject *>(d->receiver))
538 point = go->mapFromScene(point);
539#endif
540
541 // inform the scroller about the new event
542 scroller->handleInput(inputType, point, monotonicTimer.elapsed());
543 }
544
545 // depending on the scroller state return the gesture state
546 Result result;
547 bool scrollerIsActive = (scroller->state() == QScroller::Dragging ||
549
550 // Consume all mouse events while dragging or scrolling to avoid nasty
551 // side effects with Qt's standard widgets.
552 if ((me
553#if QT_CONFIG(graphicsview)
554 || gsme
555#endif
556 ) && scrollerIsActive)
558
559 // The only problem with this approach is that we consume the
560 // MouseRelease when we start the scrolling with a flick gesture, so we
561 // have to fake a MouseRelease "somewhere" to not mess with the internal
562 // states of Qt's widgets (a QPushButton would stay in 'pressed' state
563 // forever, if it doesn't receive a MouseRelease).
564 if (me
565#if QT_CONFIG(graphicsview)
566 || gsme
567#endif
568 ) {
569 if (!scrollerWasDragging && !scrollerWasScrolling && scrollerIsActive)
570 PressDelayHandler::instance()->scrollerBecameActive(keyboardModifiers, mouseButtons);
571 else if (scrollerWasScrolling && (scroller->state() == QScroller::Dragging || scroller->state() == QScroller::Inactive))
572 PressDelayHandler::instance()->scrollerWasIntercepted();
573 }
574
575 if (!inputType) {
576 result |= Ignore;
577 } else {
578 switch (event->type()) {
580#if QT_CONFIG(graphicsview)
582#endif
585 if (pressDelay > 0) {
587
588 PressDelayHandler::instance()->pressed(event, pressDelay);
589 event->accept();
590 }
591 }
594 q->setHotSpot(globalPos);
595 result |= scrollerIsActive ? TriggerGesture : MayBeGesture;
596 break;
597
599#if QT_CONFIG(graphicsview)
601#endif
602 if (PressDelayHandler::instance()->isDelaying())
606 result |= scrollerIsActive ? TriggerGesture : Ignore;
607 break;
608
609#if QT_CONFIG(graphicsview)
611#endif
613 if (PressDelayHandler::instance()->released(event, scrollerWasDragging || scrollerWasScrolling, scrollerIsActive))
616 case QEvent::TouchEnd:
617 result |= scrollerIsActive ? FinishGesture : CancelGesture;
618 break;
619
620 default:
621 result |= Ignore;
622 break;
623 }
624 }
625 return result;
626}
627
628
635
637
638#include "moc_qflickgesture_p.cpp"
639
640#endif // QT_NO_GESTURES
void timerEvent(QTimerEvent *e) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
void scrollerBecameActive(Qt::KeyboardModifiers eventModifiers, Qt::MouseButtons eventButtons)
static PressDelayHandler * instance()
bool released(QEvent *e, bool scrollerWasActive, bool scrollerIsActive)
bool shouldEventBeIgnored(QEvent *) const
bool isDelaying() const
void pressed(QEvent *e, int delay)
void sendMouseEvent(QMouseEvent *me, int flags=0)
static QWidget * widgetAt(const QPoint &p)
Returns the widget at global screen position point, or \nullptr if there is no Qt widget there.
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
\inmodule QtCore
\inmodule QtCore
Definition qcoreevent.h:45
virtual void setAccepted(bool accepted)
Definition qcoreevent.h:307
Type
This enum type defines the valid event types in Qt.
Definition qcoreevent.h:51
@ GraphicsSceneMouseMove
Definition qcoreevent.h:189
@ GraphicsSceneMouseRelease
Definition qcoreevent.h:191
@ GraphicsSceneMousePress
Definition qcoreevent.h:190
@ MouseMove
Definition qcoreevent.h:63
@ MouseButtonPress
Definition qcoreevent.h:60
@ TouchUpdate
Definition qcoreevent.h:242
@ TouchBegin
Definition qcoreevent.h:241
@ MouseButtonDblClick
Definition qcoreevent.h:62
@ MouseButtonRelease
Definition qcoreevent.h:61
Type type() const
Returns the event type.
Definition qcoreevent.h:304
virtual QEvent * clone() const
Creates and returns an identical copy of this event.
QGesture * create(QObject *target) override
\reimp
void reset(QGesture *state) override
\reimp
QFlickGestureRecognizer(Qt::MouseButton button)
QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override
The QFlickGesture class describes a flicking gesture made by the user.The QFlickGesture is more compl...
QFlickGesture(QObject *receiver, Qt::MouseButton button, QObject *parent=nullptr)
virtual void reset(QGesture *state)
This function is called by the framework to reset a given gesture.
The QGesture class represents a gesture, containing properties that describe the corresponding user i...
Definition qgesture.h:29
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
QGraphicsScene * scene() const
Returns the current scene for the item, or \nullptr if the item is not stored in a scene.
The QGraphicsObject class provides a base class for all graphics items that require signals,...
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
Qt::MouseButton button() const
Returns the mouse button (if any) that caused the event.
Qt::MouseEventSource source() const
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifiers in use at the time the event was sent.
QPoint screenPos() const
Returns the mouse cursor position in screen coordinates.
Qt::MouseButtons buttons() const
Returns the combination of mouse buttons that were pressed at the time the event was sent.
QList< QGraphicsView * > views() const
Returns a list of all the views that display this scene.
QGraphicsItem * mouseGrabberItem() const
Returns the current mouse grabber item, or \nullptr if no item is currently grabbing the mouse.
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
quint64 timestamp() const
Returns the window system's timestamp for this event.
Definition qevent.h:58
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately before the event occurred.
Definition qevent.h:56
\inmodule QtGui
Definition qevent.h:196
Qt::MouseEventSource source() const
Definition qevent.cpp:801
\inmodule QtCore
Definition qobject.h:103
int startTimer(int interval, Qt::TimerType timerType=Qt::CoarseTimer)
This is an overloaded function that will start a timer of type timerType and a timeout of interval mi...
Definition qobject.cpp:1817
Q_INVOKABLE QObject(QObject *parent=nullptr)
Constructs an object with parent object parent.
Definition qobject.cpp:936
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
void killTimer(int id)
Kills the timer with timer identifier, id.
Definition qobject.cpp:1912
\inmodule QtCore\reentrant
Definition qpoint.h:217
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
Definition qpoint.h:404
\inmodule QtCore\reentrant
Definition qpoint.h:25
const QPointingDevice * pointingDevice() const
Returns the source device from which this event originates.
Definition qevent.cpp:330
\inmodule QtCore\reentrant
Definition qrect.h:30
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
T * data() const noexcept
Returns the value of the pointer referenced by this object.
bool isNull() const noexcept
Returns true if this object refers to \nullptr.
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
QVariant scrollMetric(ScrollMetric metric) const
Query the metric value of the scroller properties.
The QScroller class enables kinetic scrolling for any scrolling widget or graphics item.
Definition qscroller.h:26
static QScroller * scroller(QObject *target)
Returns the scroller for the given target.
Input
This enum contains an input device agnostic view of input events that are relevant for QScroller.
Definition qscroller.h:51
@ InputRelease
Definition qscroller.h:54
static QList< QScroller * > activeScrollers()
Returns an application wide list of currently active QScroller objects.
bool handleInput(Input input, const QPointF &position, qint64 timestamp=0)
This function is used by gesture recognizers to inform the scroller about a new input event.
QScrollerProperties scrollerProperties
The scroller properties of this scroller.
Definition qscroller.h:30
State state
the state of the scroller
Definition qscroller.h:28
void stop()
Stops the scroller and resets its state back to Inactive.
static bool hasScroller(QObject *target)
Returns true if a QScroller object was already created for target; false otherwise.
QPointF globalPosition() const
Returns the position of the point in this event on the screen or virtual desktop.
Definition qevent.h:123
Qt::MouseButton button() const
Returns the button that caused the event.
Definition qevent.h:116
Qt::MouseButtons buttons() const
Returns the button state when the event was generated.
Definition qevent.h:117
\inmodule QtCore
Definition qcoreevent.h:366
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
Definition qcoreevent.h:370
The QTouchEvent class contains parameters that describe a touch event.
Definition qevent.h:917
qreal toReal(bool *ok=nullptr) const
Returns the variant as a qreal if the variant has userType() \l QMetaType::Double,...
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
QWidget * topLevelWidget() const
Definition qwidget.h:312
QWidget * parentWidget() const
Returns the parent of this widget, or \nullptr if it does not have any parent widget.
Definition qwidget.h:904
QPointF mapFromGlobal(const QPointF &) const
Translates the global screen coordinate pos to widget coordinates.
QPushButton * button
[2]
else opt state
[0]
Combined button and popup list for selecting options.
Definition qcompare.h:63
MouseButton
Definition qnamespace.h:56
@ NoButton
Definition qnamespace.h:57
MouseEventSource
@ MouseEventNotSynthesized
@ NoModifier
static jboolean copy(JNIEnv *, jobject)
#define Q_FALLTHROUGH()
static QMouseEvent * copyMouseEvent(QEvent *e)
bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event)
#define qFGDebug
GLfloat GLfloat GLfloat w
[0]
GLenum target
GLbitfield flags
struct _cl_event * event
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLuint64EXT * result
[6]
#define QT_CONFIG(feature)
#define Q_UNUSED(x)
#define QWIDGETSIZE_MAX
Definition qwidget.h:917
QWidget * qobject_cast< QWidget * >(QObject *o)
Definition qwidget.h:786
QObject::connect nullptr
QGraphicsScene scene
[0]
QScroller * scroller