QtBase  v6.3.1
qgraphicssceneevent.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of the QtWidgets 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 
260 #include "qgraphicssceneevent.h"
261 
262 #ifndef QT_NO_DEBUG_STREAM
263 #include <QtCore/qdebug.h>
264 #include <private/qdebug_p.h>
265 #endif
266 #include <QtCore/qmap.h>
267 #include <QtCore/qpoint.h>
268 #include <QtCore/qsize.h>
269 #include <QtCore/qstring.h>
270 #include "qgraphicsview.h"
271 #include "qgraphicsitem.h"
272 #include <QtWidgets/qgesture.h>
273 #include <private/qevent_p.h>
274 
276 
278 {
279 public:
281  : widget(nullptr),
282  q_ptr(nullptr)
283  { }
284 
286  { }
287 
291 };
292 
299  : QEvent(type), d_ptr(new QGraphicsSceneEventPrivate)
300 {
301  d_ptr->q_ptr = this;
302 }
303 
310  : QEvent(type), d_ptr(&dd)
311 {
312  d_ptr->q_ptr = this;
313 }
314 
319 {
320 }
321 
327 {
328  return d_ptr->widget;
329 }
330 
339 {
340  d_ptr->widget = widget;
341 }
342 
350 {
351  return d_ptr->timestamp;
352 }
359 {
360  d_ptr->timestamp = ts;
361 }
362 
364 {
365  Q_DECLARE_PUBLIC(QGraphicsSceneMouseEvent)
366 public:
369  { }
370 
381  Qt::MouseButtons buttons;
382  Qt::KeyboardModifiers modifiers;
384  Qt::MouseEventFlags flags;
385 };
386 
394 {
395 }
396 
401 {
402 }
403 
410 {
411  Q_D(const QGraphicsSceneMouseEvent);
412  return d->pos;
413 }
414 
419 {
421  d->pos = pos;
422 }
423 
430 {
431  Q_D(const QGraphicsSceneMouseEvent);
432  return d->scenePos;
433 }
434 
439 {
441  d->scenePos = pos;
442 }
443 
450 {
451  Q_D(const QGraphicsSceneMouseEvent);
452  return d->screenPos;
453 }
454 
459 {
461  d->screenPos = pos;
462 }
463 
471 {
472  Q_D(const QGraphicsSceneMouseEvent);
473  return d->buttonDownPos.value(button);
474 }
475 
480 {
482  d->buttonDownPos.insert(button, pos);
483 }
484 
492 {
493  Q_D(const QGraphicsSceneMouseEvent);
494  return d->buttonDownScenePos.value(button);
495 }
496 
501 {
503  d->buttonDownScenePos.insert(button, pos);
504 }
505 
513 {
514  Q_D(const QGraphicsSceneMouseEvent);
515  return d->buttonDownScreenPos.value(button);
516 }
517 
522 {
524  d->buttonDownScreenPos.insert(button, pos);
525 }
526 
534 {
535  Q_D(const QGraphicsSceneMouseEvent);
536  return d->lastPos;
537 }
538 
543 {
545  d->lastPos = pos;
546 }
547 
557 {
558  Q_D(const QGraphicsSceneMouseEvent);
559  return d->lastScenePos;
560 }
561 
566 {
568  d->lastScenePos = pos;
569 }
570 
580 {
581  Q_D(const QGraphicsSceneMouseEvent);
582  return d->lastScreenPos;
583 }
584 
589 {
591  d->lastScreenPos = pos;
592 }
593 
600 Qt::MouseButtons QGraphicsSceneMouseEvent::buttons() const
601 {
602  Q_D(const QGraphicsSceneMouseEvent);
603  return d->buttons;
604 }
605 
609 void QGraphicsSceneMouseEvent::setButtons(Qt::MouseButtons buttons)
610 {
612  d->buttons = buttons;
613 }
614 
621 {
622  Q_D(const QGraphicsSceneMouseEvent);
623  return d->button;
624 }
625 
630 {
632  d->button = button;
633 }
634 
641 Qt::KeyboardModifiers QGraphicsSceneMouseEvent::modifiers() const
642 {
643  Q_D(const QGraphicsSceneMouseEvent);
644  return d->modifiers;
645 }
646 
660 {
661  Q_D(const QGraphicsSceneMouseEvent);
662  return d->source;
663 }
664 
670 {
672  d->source = source;
673 }
674 
685 Qt::MouseEventFlags QGraphicsSceneMouseEvent::flags() const
686 {
687  Q_D(const QGraphicsSceneMouseEvent);
688  return d->flags;
689 }
690 
695 void QGraphicsSceneMouseEvent::setFlags(Qt::MouseEventFlags flags)
696 {
698  d->flags = flags;
699 }
700 
704 void QGraphicsSceneMouseEvent::setModifiers(Qt::KeyboardModifiers modifiers)
705 {
707  d->modifiers = modifiers;
708 }
709 
711 {
712  Q_DECLARE_PUBLIC(QGraphicsSceneWheelEvent)
713 public:
715 
720  Qt::MouseButtons buttons;
721  Qt::KeyboardModifiers modifiers;
722  int delta = 0;
725  bool inverted = false;
726 };
727 
736 {
737 }
738 
743 {
744 }
745 
753 {
754  Q_D(const QGraphicsSceneWheelEvent);
755  return d->pos;
756 }
757 
762 {
764  d->pos = pos;
765 }
766 
774 {
775  Q_D(const QGraphicsSceneWheelEvent);
776  return d->scenePos;
777 }
778 
783 {
785  d->scenePos = pos;
786 }
787 
795 {
796  Q_D(const QGraphicsSceneWheelEvent);
797  return d->screenPos;
798 }
799 
804 {
806  d->screenPos = pos;
807 }
808 
814 Qt::MouseButtons QGraphicsSceneWheelEvent::buttons() const
815 {
816  Q_D(const QGraphicsSceneWheelEvent);
817  return d->buttons;
818 }
819 
823 void QGraphicsSceneWheelEvent::setButtons(Qt::MouseButtons buttons)
824 {
826  d->buttons = buttons;
827 }
828 
835 Qt::KeyboardModifiers QGraphicsSceneWheelEvent::modifiers() const
836 {
837  Q_D(const QGraphicsSceneWheelEvent);
838  return d->modifiers;
839 }
840 
844 void QGraphicsSceneWheelEvent::setModifiers(Qt::KeyboardModifiers modifiers)
845 {
847  d->modifiers = modifiers;
848 }
849 
860 {
861  Q_D(const QGraphicsSceneWheelEvent);
862  return d->delta;
863 }
864 
869 {
871  d->delta = delta;
872 }
873 
878 {
879  Q_D(const QGraphicsSceneWheelEvent);
880  return d->orientation;
881 }
882 
887 {
889  d->orientation = orientation;
890 }
891 
900 {
901  Q_D(const QGraphicsSceneWheelEvent);
902  return d->scrollPhase;
903 }
904 
909 {
911  d->scrollPhase = scrollPhase;
912 }
913 
925 {
926  Q_D(const QGraphicsSceneWheelEvent);
927  return d->pixelDelta;
928 }
929 
934 {
936  d->pixelDelta = pixelDelta;
937 }
938 
945 {
946  Q_D(const QGraphicsSceneWheelEvent);
947  return d->inverted;
948 }
949 
954 {
956  d->inverted = inverted;
957 }
958 
960 {
961  Q_DECLARE_PUBLIC(QGraphicsSceneContextMenuEvent)
962  public:
964 
968  Qt::KeyboardModifiers modifiers;
970 };
971 
979 {
980 }
981 
986 {
987 }
988 
996 {
998  return d->pos;
999 }
1000 
1009 {
1011  d->pos = pos;
1012 }
1013 
1021 {
1022  Q_D(const QGraphicsSceneContextMenuEvent);
1023  return d->scenePos;
1024 }
1025 
1034 {
1036  d->scenePos = pos;
1037 }
1038 
1046 {
1047  Q_D(const QGraphicsSceneContextMenuEvent);
1048  return d->screenPos;
1049 }
1050 
1059 {
1061  d->screenPos = pos;
1062 }
1063 
1067 Qt::KeyboardModifiers QGraphicsSceneContextMenuEvent::modifiers() const
1068 {
1069  Q_D(const QGraphicsSceneContextMenuEvent);
1070  return d->modifiers;
1071 }
1072 
1079 void QGraphicsSceneContextMenuEvent::setModifiers(Qt::KeyboardModifiers modifiers)
1080 {
1082  d->modifiers = modifiers;
1083 }
1084 
1091 {
1092  Q_D(const QGraphicsSceneContextMenuEvent);
1093  return d->reason;
1094 }
1095 
1103 {
1105  d->reason = reason;
1106 }
1107 
1109 {
1110 public:
1117  Qt::KeyboardModifiers modifiers;
1118 };
1119 
1127 {
1128 }
1129 
1134 {
1135 }
1136 
1144 {
1145  Q_D(const QGraphicsSceneHoverEvent);
1146  return d->pos;
1147 }
1148 
1157 {
1159  d->pos = pos;
1160 }
1161 
1169 {
1170  Q_D(const QGraphicsSceneHoverEvent);
1171  return d->scenePos;
1172 }
1173 
1182 {
1184  d->scenePos = pos;
1185 }
1186 
1194 {
1195  Q_D(const QGraphicsSceneHoverEvent);
1196  return d->screenPos;
1197 }
1198 
1207 {
1209  d->screenPos = pos;
1210 }
1211 
1220 {
1221  Q_D(const QGraphicsSceneHoverEvent);
1222  return d->lastPos;
1223 }
1224 
1229 {
1231  d->lastPos = pos;
1232 }
1233 
1244 {
1245  Q_D(const QGraphicsSceneHoverEvent);
1246  return d->lastScenePos;
1247 }
1248 
1253 {
1255  d->lastScenePos = pos;
1256 }
1257 
1268 {
1269  Q_D(const QGraphicsSceneHoverEvent);
1270  return d->lastScreenPos;
1271 }
1272 
1277 {
1279  d->lastScreenPos = pos;
1280 }
1281 
1287 Qt::KeyboardModifiers QGraphicsSceneHoverEvent::modifiers() const
1288 {
1289  Q_D(const QGraphicsSceneHoverEvent);
1290  return d->modifiers;
1291 }
1292 
1299 void QGraphicsSceneHoverEvent::setModifiers(Qt::KeyboardModifiers modifiers)
1300 {
1302  d->modifiers = modifiers;
1303 }
1304 
1306 {
1307 public:
1310 };
1311 
1319 {
1320 }
1321 
1326 {
1327 }
1328 
1336 {
1337  Q_D(const QGraphicsSceneHelpEvent);
1338  return d->scenePos;
1339 }
1340 
1349 {
1351  d->scenePos = pos;
1352 }
1353 
1361 {
1362  Q_D(const QGraphicsSceneHelpEvent);
1363  return d->screenPos;
1364 }
1365 
1374 {
1376  d->screenPos = pos;
1377 }
1378 
1380 {
1381  Q_DECLARE_PUBLIC(QGraphicsSceneDragDropEvent)
1382 public:
1385  { }
1386 
1390  Qt::MouseButtons buttons;
1391  Qt::KeyboardModifiers modifiers;
1392  Qt::DropActions possibleActions;
1397 };
1398 
1409 {
1410 }
1411 
1416 {
1417 }
1418 
1426 {
1427  Q_D(const QGraphicsSceneDragDropEvent);
1428  return d->pos;
1429 }
1430 
1441 {
1443  d->pos = pos;
1444 }
1445 
1452 {
1453  Q_D(const QGraphicsSceneDragDropEvent);
1454  return d->scenePos;
1455 }
1456 
1464 {
1466  d->scenePos = pos;
1467 }
1468 
1475 {
1476  Q_D(const QGraphicsSceneDragDropEvent);
1477  return d->screenPos;
1478 }
1479 
1487 {
1489  d->screenPos = pos;
1490 }
1491 
1500 {
1501  Q_D(const QGraphicsSceneDragDropEvent);
1502  return d->buttons;
1503 }
1504 
1512 void QGraphicsSceneDragDropEvent::setButtons(Qt::MouseButtons buttons)
1513 {
1515  d->buttons = buttons;
1516 }
1517 
1524 Qt::KeyboardModifiers QGraphicsSceneDragDropEvent::modifiers() const
1525 {
1526  Q_D(const QGraphicsSceneDragDropEvent);
1527  return d->modifiers;
1528 }
1529 
1538 void QGraphicsSceneDragDropEvent::setModifiers(Qt::KeyboardModifiers modifiers)
1539 {
1541  d->modifiers = modifiers;
1542 }
1543 
1552 {
1553  Q_D(const QGraphicsSceneDragDropEvent);
1554  return d->possibleActions;
1555 }
1556 
1565 {
1567  d->possibleActions = actions;
1568 }
1569 
1579 {
1580  Q_D(const QGraphicsSceneDragDropEvent);
1581  return d->proposedAction;
1582 }
1583 
1594 {
1596  d->proposedAction = action;
1597 }
1598 
1611 {
1613  d->dropAction = d->proposedAction;
1614 }
1615 
1625 {
1626  Q_D(const QGraphicsSceneDragDropEvent);
1627  return d->dropAction;
1628 }
1629 
1641 {
1643  d->dropAction = action;
1644 }
1645 
1651 {
1652  Q_D(const QGraphicsSceneDragDropEvent);
1653  return d->source;
1654 }
1655 
1662 {
1664  d->source = source;
1665 }
1666 
1671 {
1672  Q_D(const QGraphicsSceneDragDropEvent);
1673  return d->mimeData;
1674 }
1675 
1681 {
1683  d->mimeData = data;
1684 }
1685 
1687 {
1688  Q_DECLARE_PUBLIC(QGraphicsSceneResizeEvent)
1689 public:
1691  { }
1692 
1695 };
1696 
1701  : QGraphicsSceneEvent(*new QGraphicsSceneResizeEventPrivate, QEvent::GraphicsSceneResize)
1702 {
1703 }
1704 
1709 {
1710 }
1711 
1719 {
1720  Q_D(const QGraphicsSceneResizeEvent);
1721  return d->oldSize;
1722 }
1723 
1728 {
1730  d->oldSize = size;
1731 }
1732 
1739 {
1740  Q_D(const QGraphicsSceneResizeEvent);
1741  return d->newSize;
1742 }
1743 
1748 {
1750  d->newSize = size;
1751 }
1752 
1754 {
1755  Q_DECLARE_PUBLIC(QGraphicsSceneMoveEvent)
1756 public:
1758  { }
1759 
1762 };
1763 
1768  : QGraphicsSceneEvent(*new QGraphicsSceneMoveEventPrivate, QEvent::GraphicsSceneMove)
1769 {
1770 }
1771 
1776 {
1777 }
1778 
1786 {
1787  Q_D(const QGraphicsSceneMoveEvent);
1788  return d->oldPos;
1789 }
1790 
1795 {
1797  d->oldPos = pos;
1798 }
1799 
1806 {
1807  Q_D(const QGraphicsSceneMoveEvent);
1808  return d->newPos;
1809 }
1810 
1815 {
1817  d->newPos = pos;
1818 }
1819 
1820 #ifndef QT_NO_DEBUG_STREAM
1821 template <class Event>
1822 static inline void formatPositions(QDebug &debug, const Event *event)
1823 {
1824  debug << ", pos=";
1825  QtDebugUtils::formatQPoint(debug, event->pos());
1826  debug << ", scenePos=";
1827  QtDebugUtils::formatQPoint(debug, event->scenePos());
1828  debug << ", screenPos=";
1829  QtDebugUtils::formatQPoint(debug, event->screenPos());
1830 }
1831 
1833 {
1834  QDebugStateSaver saver(debug);
1835  debug.nospace();
1836  if (!event) {
1837  debug << "QGraphicsSceneEvent(0)";
1838  return debug;
1839  }
1840 
1841  const QEvent::Type type = event->type();
1842  switch (type) {
1847  const QGraphicsSceneMouseEvent *me = static_cast<const QGraphicsSceneMouseEvent *>(event);
1848  const Qt::MouseButton button = me->button();
1849  const Qt::MouseButtons buttons = me->buttons();
1850  debug << "QGraphicsSceneMouseEvent(";
1851  QtDebugUtils::formatQEnum(debug, type);
1853  debug << ", ";
1854  QtDebugUtils::formatQEnum(debug, button);
1855  }
1856  if (buttons && button != buttons) {
1857  debug << ", buttons=";
1858  QtDebugUtils::formatQFlags(debug, buttons);
1859  }
1860  QtDebugUtils::formatNonNullQFlags(debug, ", ", me->modifiers());
1861  formatPositions(debug, me);
1862  QtDebugUtils::formatNonNullQEnum(debug, ", ", me->source());
1863  QtDebugUtils::formatNonNullQFlags(debug, ", flags=", me->flags());
1864  debug << ')';
1865  }
1866  break;
1868  const QGraphicsSceneContextMenuEvent *ce = static_cast<const QGraphicsSceneContextMenuEvent *>(event);
1869  debug << "QGraphicsSceneContextMenuEvent(reason=" << ce->reason();
1870  QtDebugUtils::formatNonNullQFlags(debug, ", ", ce->modifiers());
1871  formatPositions(debug, ce);
1872  debug << ')';
1873  }
1874  break;
1878  debug << "QGraphicsSceneHoverEvent(";
1879  formatPositions(debug, static_cast<const QGraphicsSceneHoverEvent *>(event));
1880  debug << ')';
1881  break;
1883  break;
1888  const QGraphicsSceneDragDropEvent *de = static_cast<const QGraphicsSceneDragDropEvent *>(event);
1889  debug << "QGraphicsSceneDragDropEvent(proposedAction=";
1890  QtDebugUtils::formatQEnum(debug, de->proposedAction());
1891  debug << ", possibleActions=";
1892  QtDebugUtils::formatQFlags(debug, de->possibleActions());
1893  debug << ", source=" << de->source();
1894  QtDebugUtils::formatNonNullQFlags(debug, ", buttons=", de->buttons());
1895  QtDebugUtils::formatNonNullQFlags(debug, ", ", de->modifiers());
1896  formatPositions(debug, de);
1897  }
1898  break;
1900  const QGraphicsSceneWheelEvent *we = static_cast<const QGraphicsSceneWheelEvent *>(event);
1901  debug << "QGraphicsSceneWheelEvent(";
1902  QtDebugUtils::formatNonNullQFlags(debug, ", buttons=", we->buttons());
1903  QtDebugUtils::formatNonNullQFlags(debug, ", ", we->modifiers());
1904  formatPositions(debug, we);
1905  debug << ')';
1906  }
1907  break;
1908  default:
1909  break;
1910  }
1911  return debug;
1912 }
1913 #endif // !QT_NO_DEBUG_STREAM
1914 
operator<<(QDataStream &ds, qfloat16 f)
Definition: qfloat16.cpp:327
The QDebug class provides an output stream for debugging information.
Definition: qdebug.h:65
Convenience class for custom QDebug operators.
Definition: qdebug.h:176
The QEvent class is the base class of all event classes. Event objects contain event parameters.
Definition: qcoreevent.h:58
@ GraphicsSceneDragLeave
Definition: qcoreevent.h:213
@ GraphicsSceneMouseMove
Definition: qcoreevent.h:202
@ GraphicsSceneContextMenu
Definition: qcoreevent.h:206
@ GraphicsSceneMouseRelease
Definition: qcoreevent.h:204
@ GraphicsSceneDragEnter
Definition: qcoreevent.h:211
@ GraphicsSceneDragMove
Definition: qcoreevent.h:212
@ GraphicsSceneMousePress
Definition: qcoreevent.h:203
@ GraphicsSceneHoverLeave
Definition: qcoreevent.h:209
@ GraphicsSceneMouseDoubleClick
Definition: qcoreevent.h:205
@ GraphicsSceneWheel
Definition: qcoreevent.h:215
@ GraphicsSceneDrop
Definition: qcoreevent.h:214
@ GraphicsSceneHoverEnter
Definition: qcoreevent.h:207
@ GraphicsSceneHoverMove
Definition: qcoreevent.h:208
@ GraphicsSceneHelp
Definition: qcoreevent.h:210
The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework.
void setModifiers(Qt::KeyboardModifiers modifiers)
void setScenePos(const QPointF &pos)
void setScreenPos(const QPoint &pos)
Qt::KeyboardModifiers modifiers() const
QGraphicsSceneContextMenuEvent::Reason reason
The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framewor...
void setButtons(Qt::MouseButtons buttons)
void setMimeData(const QMimeData *data)
void setPossibleActions(Qt::DropActions actions)
void setProposedAction(Qt::DropAction action)
void setModifiers(Qt::KeyboardModifiers modifiers)
Qt::DropAction dropAction() const
void setDropAction(Qt::DropAction action)
Qt::DropActions possibleActions() const
Qt::KeyboardModifiers modifiers() const
void setScreenPos(const QPoint &pos)
void setPos(const QPointF &pos)
Qt::MouseButtons buttons() const
const QMimeData * mimeData() const
void setScenePos(const QPointF &pos)
Qt::DropAction proposedAction() const
The QGraphicsSceneEvent class provides a base class for all graphics view related events.
QScopedPointer< QGraphicsSceneEventPrivate > d_ptr
void setWidget(QWidget *widget)
void setTimestamp(quint64 ts)
QWidget * widget() const
The QGraphicsSceneHelpEvent class provides events when a tooltip is requested.
QGraphicsSceneHelpEvent(Type type=None)
void setScenePos(const QPointF &pos)
void setScreenPos(const QPoint &pos)
The QGraphicsSceneHoverEvent class provides hover events in the graphics view framework.
void setScreenPos(const QPoint &pos)
void setPos(const QPointF &pos)
void setLastPos(const QPointF &pos)
void setScenePos(const QPointF &pos)
void setModifiers(Qt::KeyboardModifiers modifiers)
QGraphicsSceneHoverEvent(Type type=None)
void setLastScenePos(const QPointF &pos)
void setLastScreenPos(const QPoint &pos)
Qt::KeyboardModifiers modifiers() const
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
Qt::MouseButton button() const
void setFlags(Qt::MouseEventFlags)
void setButtonDownPos(Qt::MouseButton button, const QPointF &pos)
QPointF buttonDownScenePos(Qt::MouseButton button) const
Qt::MouseEventFlags flags() const
QGraphicsSceneMouseEvent(Type type=None)
void setLastScenePos(const QPointF &pos)
Qt::MouseEventSource source() const
QPoint buttonDownScreenPos(Qt::MouseButton button) const
void setLastPos(const QPointF &pos)
void setButton(Qt::MouseButton button)
Qt::KeyboardModifiers modifiers() const
void setScenePos(const QPointF &pos)
void setPos(const QPointF &pos)
Qt::MouseButtons buttons() const
void setButtonDownScenePos(Qt::MouseButton button, const QPointF &pos)
void setButtons(Qt::MouseButtons buttons)
void setModifiers(Qt::KeyboardModifiers modifiers)
void setButtonDownScreenPos(Qt::MouseButton button, const QPoint &pos)
void setLastScreenPos(const QPoint &pos)
QPointF buttonDownPos(Qt::MouseButton button) const
void setSource(Qt::MouseEventSource source)
void setScreenPos(const QPoint &pos)
QMap< Qt::MouseButton, QPointF > buttonDownScenePos
QMap< Qt::MouseButton, QPointF > buttonDownPos
QMap< Qt::MouseButton, QPoint > buttonDownScreenPos
The QGraphicsSceneMoveEvent class provides events for widget moving in the graphics view framework.
void setOldPos(const QPointF &pos)
void setNewPos(const QPointF &pos)
The QGraphicsSceneResizeEvent class provides events for widget resizing in the graphics view framewor...
void setOldSize(const QSizeF &size)
void setNewSize(const QSizeF &size)
The QGraphicsSceneWheelEvent class provides wheel events in the graphics view framework.
void setScreenPos(const QPoint &pos)
void setPixelDelta(QPoint delta)
Qt::KeyboardModifiers modifiers() const
void setInverted(bool inverted)
Qt::Orientation orientation() const
QGraphicsSceneWheelEvent(Type type=None)
void setButtons(Qt::MouseButtons buttons)
void setPos(const QPointF &pos)
Qt::MouseButtons buttons() const
void setScenePos(const QPointF &pos)
void setOrientation(Qt::Orientation orientation)
Qt::ScrollPhase phase() const
void setModifiers(Qt::KeyboardModifiers modifiers)
void setPhase(Qt::ScrollPhase scrollPhase)
The QMimeData class provides a container for data that records information about its MIME type.
Definition: qmimedata.h:52
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:242
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:52
The QSizeF class defines the size of a two-dimensional object using floating point precision.
Definition: qsize.h:235
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:133
QOpenGLWidget * widget
[1]
QPushButton * button
[2]
Definition: qnamespace.h:55
MouseButton
Definition: qnamespace.h:81
@ NoButton
Definition: qnamespace.h:82
Orientation
Definition: qnamespace.h:123
@ Horizontal
Definition: qnamespace.h:124
MouseEventSource
Definition: qnamespace.h:1703
@ MouseEventNotSynthesized
Definition: qnamespace.h:1704
DropAction
Definition: qnamespace.h:1484
ScrollPhase
Definition: qnamespace.h:1695
@ NoScrollPhase
Definition: qnamespace.h:1696
action
Definition: devices.py:78
unsigned long long quint64
Definition: qglobal.h:299
GLenum type
Definition: qopengl.h:270
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLbitfield flags
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLsizei GLsizei GLchar * source
struct _cl_event * event
Definition: qopenglext.h:2998
QObject::connect nullptr
Definition: moc.h:48