QtBase  v6.3.1
qgraphicsitem.h
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 
40 #ifndef QGRAPHICSITEM_H
41 #define QGRAPHICSITEM_H
42 
43 #include <QtWidgets/qtwidgetsglobal.h>
44 #include <QtCore/qobject.h>
45 #include <QtCore/qvariant.h>
46 #include <QtCore/qrect.h>
47 #include <QtCore/qscopedpointer.h>
48 #include <QtGui/qpainterpath.h>
49 #include <QtGui/qpixmap.h>
50 
51 class tst_QGraphicsItem;
52 
53 QT_REQUIRE_CONFIG(graphicsview);
54 
56 
57 class QBrush;
58 class QCursor;
59 class QFocusEvent;
60 class QGraphicsEffect;
61 class QGraphicsItemGroup;
62 class QGraphicsObject;
69 class QGraphicsScene;
70 class QGraphicsTransform;
71 class QGraphicsWidget;
72 class QInputMethodEvent;
73 class QKeyEvent;
74 class QMenu;
75 class QPainter;
76 class QPen;
77 class QPointF;
78 class QRectF;
80 
82 class Q_WIDGETS_EXPORT QGraphicsItem
83 {
84 public:
86  ItemIsMovable = 0x1,
88  ItemIsFocusable = 0x4,
89  ItemClipsToShape = 0x8,
90  ItemClipsChildrenToShape = 0x10,
91  ItemIgnoresTransformations = 0x20,
92  ItemIgnoresParentOpacity = 0x40,
93  ItemDoesntPropagateOpacityToChildren = 0x80,
94  ItemStacksBehindParent = 0x100,
95  ItemUsesExtendedStyleOption = 0x200,
96  ItemHasNoContents = 0x400,
97  ItemSendsGeometryChanges = 0x800,
98  ItemAcceptsInputMethod = 0x1000,
99  ItemNegativeZStacksBehindParent = 0x2000,
100  ItemIsPanel = 0x4000,
101  ItemIsFocusScope = 0x8000, // internal
102  ItemSendsScenePositionChanges = 0x10000,
103  ItemStopsClickFocusPropagation = 0x20000,
104  ItemStopsFocusHandling = 0x40000,
105  ItemContainsChildrenInShape = 0x80000
106  // NB! Don't forget to increase the d_ptr->flags bit field by 1 when adding a new flag.
107  };
108  Q_DECLARE_FLAGS(GraphicsItemFlags, GraphicsItemFlag)
109 
112  ItemVisibleChange = 2,
143  ItemTransformOriginPointHasChanged
144  };
145 
146  enum CacheMode {
149  DeviceCoordinateCache
150  };
151 
153  {
156  SceneModal
157  };
158 
159  explicit QGraphicsItem(QGraphicsItem *parent = nullptr);
160  virtual ~QGraphicsItem();
161 
162  QGraphicsScene *scene() const;
163 
164  QGraphicsItem *parentItem() const;
165  QGraphicsItem *topLevelItem() const;
166  QGraphicsObject *parentObject() const;
167  QGraphicsWidget *parentWidget() const;
168  QGraphicsWidget *topLevelWidget() const;
169  QGraphicsWidget *window() const;
170  QGraphicsItem *panel() const;
171  void setParentItem(QGraphicsItem *parent);
172  QList<QGraphicsItem *> childItems() const;
173  bool isWidget() const;
174  bool isWindow() const;
175  bool isPanel() const;
176 
177  QGraphicsObject *toGraphicsObject();
178  const QGraphicsObject *toGraphicsObject() const;
179 
180  QGraphicsItemGroup *group() const;
181  void setGroup(QGraphicsItemGroup *group);
182 
183  GraphicsItemFlags flags() const;
184  void setFlag(GraphicsItemFlag flag, bool enabled = true);
185  void setFlags(GraphicsItemFlags flags);
186 
187  CacheMode cacheMode() const;
188  void setCacheMode(CacheMode mode, const QSize &cacheSize = QSize());
189 
190  PanelModality panelModality() const;
191  void setPanelModality(PanelModality panelModality);
192  bool isBlockedByModalPanel(QGraphicsItem **blockingPanel = nullptr) const;
193 
194 #if QT_CONFIG(tooltip)
195  QString toolTip() const;
196  void setToolTip(const QString &toolTip);
197 #endif
198 
199 #ifndef QT_NO_CURSOR
200  QCursor cursor() const;
201  void setCursor(const QCursor &cursor);
202  bool hasCursor() const;
203  void unsetCursor();
204 #endif
205 
206  bool isVisible() const;
207  bool isVisibleTo(const QGraphicsItem *parent) const;
208  void setVisible(bool visible);
209  inline void hide() { setVisible(false); }
210  inline void show() { setVisible(true); }
211 
212  bool isEnabled() const;
213  void setEnabled(bool enabled);
214 
215  bool isSelected() const;
216  void setSelected(bool selected);
217 
218  bool acceptDrops() const;
219  void setAcceptDrops(bool on);
220 
221  qreal opacity() const;
222  qreal effectiveOpacity() const;
223  void setOpacity(qreal opacity);
224 
225 #if QT_CONFIG(graphicseffect)
226  // Effect
227  QGraphicsEffect *graphicsEffect() const;
228  void setGraphicsEffect(QGraphicsEffect *effect);
229 #endif // QT_CONFIG(graphicseffect)
230 
231  Qt::MouseButtons acceptedMouseButtons() const;
232  void setAcceptedMouseButtons(Qt::MouseButtons buttons);
233  bool acceptHoverEvents() const;
234  void setAcceptHoverEvents(bool enabled);
235  bool acceptTouchEvents() const;
236  void setAcceptTouchEvents(bool enabled);
237 
238  bool filtersChildEvents() const;
239  void setFiltersChildEvents(bool enabled);
240 
241  bool handlesChildEvents() const;
242  void setHandlesChildEvents(bool enabled);
243 
244  bool isActive() const;
245  void setActive(bool active);
246 
247  bool hasFocus() const;
248  void setFocus(Qt::FocusReason focusReason = Qt::OtherFocusReason);
249  void clearFocus();
250 
251  QGraphicsItem *focusProxy() const;
252  void setFocusProxy(QGraphicsItem *item);
253 
254  QGraphicsItem *focusItem() const;
255  QGraphicsItem *focusScopeItem() const;
256 
257  void grabMouse();
258  void ungrabMouse();
259  void grabKeyboard();
260  void ungrabKeyboard();
261 
262  // Positioning in scene coordinates
263  QPointF pos() const;
264  inline qreal x() const { return pos().x(); }
265  void setX(qreal x);
266  inline qreal y() const { return pos().y(); }
267  void setY(qreal y);
268  QPointF scenePos() const;
269  void setPos(const QPointF &pos);
270  inline void setPos(qreal x, qreal y);
271  inline void moveBy(qreal dx, qreal dy) { setPos(pos().x() + dx, pos().y() + dy); }
272 
273  void ensureVisible(const QRectF &rect = QRectF(), int xmargin = 50, int ymargin = 50);
274  inline void ensureVisible(qreal x, qreal y, qreal w, qreal h, int xmargin = 50, int ymargin = 50);
275 
276  // Local transformation
277  QTransform transform() const;
278  QTransform sceneTransform() const;
279  QTransform deviceTransform(const QTransform &viewportTransform) const;
280  QTransform itemTransform(const QGraphicsItem *other, bool *ok = nullptr) const;
281  void setTransform(const QTransform &matrix, bool combine = false);
282  void resetTransform();
283  void setRotation(qreal angle);
284  qreal rotation() const;
285 
286  void setScale(qreal scale);
287  qreal scale() const;
288 
289  QList<QGraphicsTransform *> transformations() const;
290  void setTransformations(const QList<QGraphicsTransform *> &transformations);
291 
292  QPointF transformOriginPoint() const;
293  void setTransformOriginPoint(const QPointF &origin);
294  inline void setTransformOriginPoint(qreal ax, qreal ay)
295  { setTransformOriginPoint(QPointF(ax,ay)); }
296 
297  virtual void advance(int phase);
298 
299  // Stacking order
300  qreal zValue() const;
301  void setZValue(qreal z);
302  void stackBefore(const QGraphicsItem *sibling);
303 
304  // Hit test
305  virtual QRectF boundingRect() const = 0;
306  QRectF childrenBoundingRect() const;
307  QRectF sceneBoundingRect() const;
308  virtual QPainterPath shape() const;
309  bool isClipped() const;
310  QPainterPath clipPath() const;
311  virtual bool contains(const QPointF &point) const;
312  virtual bool collidesWithItem(const QGraphicsItem *other, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
313  virtual bool collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
315  bool isObscured(const QRectF &rect = QRectF()) const;
316  inline bool isObscured(qreal x, qreal y, qreal w, qreal h) const;
317  virtual bool isObscuredBy(const QGraphicsItem *item) const;
318  virtual QPainterPath opaqueArea() const;
319 
320  QRegion boundingRegion(const QTransform &itemToDeviceTransform) const;
321  qreal boundingRegionGranularity() const;
322  void setBoundingRegionGranularity(qreal granularity);
323 
324  // Drawing
325  virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) = 0;
326  void update(const QRectF &rect = QRectF());
327  inline void update(qreal x, qreal y, qreal width, qreal height);
328  void scroll(qreal dx, qreal dy, const QRectF &rect = QRectF());
329 
330  // Coordinate mapping
331  QPointF mapToItem(const QGraphicsItem *item, const QPointF &point) const;
332  QPointF mapToParent(const QPointF &point) const;
333  QPointF mapToScene(const QPointF &point) const;
334  QPolygonF mapToItem(const QGraphicsItem *item, const QRectF &rect) const;
335  QPolygonF mapToParent(const QRectF &rect) const;
336  QPolygonF mapToScene(const QRectF &rect) const;
337  QRectF mapRectToItem(const QGraphicsItem *item, const QRectF &rect) const;
338  QRectF mapRectToParent(const QRectF &rect) const;
339  QRectF mapRectToScene(const QRectF &rect) const;
340  QPolygonF mapToItem(const QGraphicsItem *item, const QPolygonF &polygon) const;
341  QPolygonF mapToParent(const QPolygonF &polygon) const;
342  QPolygonF mapToScene(const QPolygonF &polygon) const;
343  QPainterPath mapToItem(const QGraphicsItem *item, const QPainterPath &path) const;
344  QPainterPath mapToParent(const QPainterPath &path) const;
345  QPainterPath mapToScene(const QPainterPath &path) const;
346  QPointF mapFromItem(const QGraphicsItem *item, const QPointF &point) const;
347  QPointF mapFromParent(const QPointF &point) const;
348  QPointF mapFromScene(const QPointF &point) const;
349  QPolygonF mapFromItem(const QGraphicsItem *item, const QRectF &rect) const;
350  QPolygonF mapFromParent(const QRectF &rect) const;
351  QPolygonF mapFromScene(const QRectF &rect) const;
352  QRectF mapRectFromItem(const QGraphicsItem *item, const QRectF &rect) const;
353  QRectF mapRectFromParent(const QRectF &rect) const;
354  QRectF mapRectFromScene(const QRectF &rect) const;
355  QPolygonF mapFromItem(const QGraphicsItem *item, const QPolygonF &polygon) const;
356  QPolygonF mapFromParent(const QPolygonF &polygon) const;
357  QPolygonF mapFromScene(const QPolygonF &polygon) const;
358  QPainterPath mapFromItem(const QGraphicsItem *item, const QPainterPath &path) const;
359  QPainterPath mapFromParent(const QPainterPath &path) const;
360  QPainterPath mapFromScene(const QPainterPath &path) const;
361 
362  inline QPointF mapToItem(const QGraphicsItem *item, qreal x, qreal y) const;
363  inline QPointF mapToParent(qreal x, qreal y) const;
364  inline QPointF mapToScene(qreal x, qreal y) const;
365  inline QPolygonF mapToItem(const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const;
366  inline QPolygonF mapToParent(qreal x, qreal y, qreal w, qreal h) const;
367  inline QPolygonF mapToScene(qreal x, qreal y, qreal w, qreal h) const;
368  inline QRectF mapRectToItem(const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const;
369  inline QRectF mapRectToParent(qreal x, qreal y, qreal w, qreal h) const;
370  inline QRectF mapRectToScene(qreal x, qreal y, qreal w, qreal h) const;
371  inline QPointF mapFromItem(const QGraphicsItem *item, qreal x, qreal y) const;
372  inline QPointF mapFromParent(qreal x, qreal y) const;
373  inline QPointF mapFromScene(qreal x, qreal y) const;
374  inline QPolygonF mapFromItem(const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const;
375  inline QPolygonF mapFromParent(qreal x, qreal y, qreal w, qreal h) const;
376  inline QPolygonF mapFromScene(qreal x, qreal y, qreal w, qreal h) const;
377  inline QRectF mapRectFromItem(const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const;
378  inline QRectF mapRectFromParent(qreal x, qreal y, qreal w, qreal h) const;
379  inline QRectF mapRectFromScene(qreal x, qreal y, qreal w, qreal h) const;
380 
381  bool isAncestorOf(const QGraphicsItem *child) const;
382  QGraphicsItem *commonAncestorItem(const QGraphicsItem *other) const;
383  bool isUnderMouse() const;
384 
385  // Custom data
386  QVariant data(int key) const;
387  void setData(int key, const QVariant &value);
388 
389  Qt::InputMethodHints inputMethodHints() const;
390  void setInputMethodHints(Qt::InputMethodHints hints);
391 
392  enum {
393  Type = 1,
394  UserType = 65536
395  };
396  virtual int type() const;
397 
398  void installSceneEventFilter(QGraphicsItem *filterItem);
399  void removeSceneEventFilter(QGraphicsItem *filterItem);
400 
401 protected:
402  void updateMicroFocus();
403  virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
404  virtual bool sceneEvent(QEvent *event);
405  virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
406  virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
407  virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
408  virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *event);
409  virtual void dropEvent(QGraphicsSceneDragDropEvent *event);
410  virtual void focusInEvent(QFocusEvent *event);
411  virtual void focusOutEvent(QFocusEvent *event);
412  virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
413  virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
414  virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
415  virtual void keyPressEvent(QKeyEvent *event);
416  virtual void keyReleaseEvent(QKeyEvent *event);
417  virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
418  virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
419  virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
420  virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
421  virtual void wheelEvent(QGraphicsSceneWheelEvent *event);
422  virtual void inputMethodEvent(QInputMethodEvent *event);
423  virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
424 
425  virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
426 
427  enum Extension {
428  UserExtension = 0x80000000
429  };
430  virtual bool supportsExtension(Extension extension) const;
431  virtual void setExtension(Extension extension, const QVariant &variant);
432  virtual QVariant extension(const QVariant &variant) const;
433 
434 protected:
437 
438  void addToIndex();
439  void removeFromIndex();
440  void prepareGeometryChange();
441 
442 private:
444  Q_DECLARE_PRIVATE(QGraphicsItem)
445  friend class QGraphicsItemGroup;
446  friend class QGraphicsScene;
447  friend class QGraphicsScenePrivate;
449  friend class QGraphicsSceneBspTree;
450  friend class QGraphicsView;
451  friend class QGraphicsViewPrivate;
452  friend class QGraphicsObject;
453  friend class QGraphicsWidget;
456  friend class QGraphicsSceneIndex;
460  friend class QGraphicsItemEffectSourcePrivate;
462 #ifndef QT_NO_GESTURES
463  friend class QGestureManager;
464 #endif
465  friend class ::tst_QGraphicsItem;
466  friend bool qt_closestLeaf(const QGraphicsItem *, const QGraphicsItem *);
467  friend bool qt_closestItemFirst(const QGraphicsItem *, const QGraphicsItem *);
468 };
469 
470 Q_DECLARE_OPERATORS_FOR_FLAGS(QGraphicsItem::GraphicsItemFlags)
471 #ifndef Q_CLANG_QDOC
472 Q_DECLARE_INTERFACE(QGraphicsItem, "org.qt-project.Qt.QGraphicsItem")
473 #endif
474 
475 inline void QGraphicsItem::setPos(qreal ax, qreal ay)
476 { setPos(QPointF(ax, ay)); }
477 inline void QGraphicsItem::ensureVisible(qreal ax, qreal ay, qreal w, qreal h, int xmargin, int ymargin)
478 { ensureVisible(QRectF(ax, ay, w, h), xmargin, ymargin); }
480 { update(QRectF(ax, ay, width, height)); }
481 inline bool QGraphicsItem::isObscured(qreal ax, qreal ay, qreal w, qreal h) const
482 { return isObscured(QRectF(ax, ay, w, h)); }
484 { return mapToItem(item, QPointF(ax, ay)); }
486 { return mapToParent(QPointF(ax, ay)); }
488 { return mapToScene(QPointF(ax, ay)); }
490 { return mapFromItem(item, QPointF(ax, ay)); }
492 { return mapFromParent(QPointF(ax, ay)); }
494 { return mapFromScene(QPointF(ax, ay)); }
496 { return mapToItem(item, QRectF(ax, ay, w, h)); }
498 { return mapToParent(QRectF(ax, ay, w, h)); }
500 { return mapToScene(QRectF(ax, ay, w, h)); }
502 { return mapRectToItem(item, QRectF(ax, ay, w, h)); }
504 { return mapRectToParent(QRectF(ax, ay, w, h)); }
506 { return mapRectToScene(QRectF(ax, ay, w, h)); }
508 { return mapFromItem(item, QRectF(ax, ay, w, h)); }
510 { return mapFromParent(QRectF(ax, ay, w, h)); }
512 { return mapFromScene(QRectF(ax, ay, w, h)); }
514 { return mapRectFromItem(item, QRectF(ax, ay, w, h)); }
516 { return mapRectFromParent(QRectF(ax, ay, w, h)); }
518 { return mapRectFromScene(QRectF(ax, ay, w, h)); }
519 
520 
521 class Q_WIDGETS_EXPORT QGraphicsObject : public QObject, public QGraphicsItem
522 {
523  Q_OBJECT
524  Q_PROPERTY(QGraphicsObject* parent READ parentObject WRITE setParentItem NOTIFY parentChanged
525  DESIGNABLE false)
526  Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged FINAL)
527  Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
528  Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL)
529  Q_PROPERTY(QPointF pos READ pos WRITE setPos FINAL)
530  Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged FINAL)
531  Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged FINAL)
532  Q_PROPERTY(qreal z READ zValue WRITE setZValue NOTIFY zChanged FINAL)
533  Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged)
534  Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged)
535  Q_PROPERTY(QPointF transformOriginPoint READ transformOriginPoint WRITE setTransformOriginPoint)
536 #if QT_CONFIG(graphicseffect)
537  Q_PROPERTY(QGraphicsEffect *effect READ graphicsEffect WRITE setGraphicsEffect)
538 #endif
539  Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), QDeclarativeListProperty<QGraphicsObject> children
540  READ childrenList DESIGNABLE false NOTIFY childrenChanged)
541  Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), qreal width READ width WRITE setWidth
542  NOTIFY widthChanged RESET resetWidth FINAL)
543  Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), qreal height READ height WRITE setHeight
544  NOTIFY heightChanged RESET resetHeight FINAL)
545  Q_CLASSINFO("DefaultProperty", "children")
547 public:
548  explicit QGraphicsObject(QGraphicsItem *parent = nullptr);
549  ~QGraphicsObject();
550 
551  using QObject::children;
552 
553 #ifndef QT_NO_GESTURES
554  void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags());
555  void ungrabGesture(Qt::GestureType type);
556 #endif
557 
558 protected Q_SLOTS:
559  void updateMicroFocus();
560 
561 Q_SIGNALS:
566  void xChanged();
567  void yChanged();
568  void zChanged();
570  void scaleChanged();
572  void widthChanged();
574 
575 protected:
577 
578  bool event(QEvent *ev) override;
579 
580 private:
581  friend class QGraphicsItem;
582  friend class QGraphicsItemPrivate;
583 };
584 
585 
587 class Q_WIDGETS_EXPORT QAbstractGraphicsShapeItem : public QGraphicsItem
588 {
589 public:
590  explicit QAbstractGraphicsShapeItem(QGraphicsItem *parent = nullptr);
592 
593  QPen pen() const;
594  void setPen(const QPen &pen);
595 
596  QBrush brush() const;
597  void setBrush(const QBrush &brush);
598 
599  bool isObscuredBy(const QGraphicsItem *item) const override;
600  QPainterPath opaqueArea() const override;
601 
602 protected:
605 
606 private:
608  Q_DECLARE_PRIVATE(QAbstractGraphicsShapeItem)
609 };
610 
612 class Q_WIDGETS_EXPORT QGraphicsPathItem : public QAbstractGraphicsShapeItem
613 {
614 public:
615  explicit QGraphicsPathItem(QGraphicsItem *parent = nullptr);
616  explicit QGraphicsPathItem(const QPainterPath &path, QGraphicsItem *parent = nullptr);
618 
619  QPainterPath path() const;
620  void setPath(const QPainterPath &path);
621 
622  QRectF boundingRect() const override;
623  QPainterPath shape() const override;
624  bool contains(const QPointF &point) const override;
625 
626  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
627 
628  bool isObscuredBy(const QGraphicsItem *item) const override;
629  QPainterPath opaqueArea() const override;
630 
631  enum { Type = 2 };
632  int type() const override;
633 
634 protected:
635  bool supportsExtension(Extension extension) const override;
636  void setExtension(Extension extension, const QVariant &variant) override;
637  QVariant extension(const QVariant &variant) const override;
638 
639 private:
641  Q_DECLARE_PRIVATE(QGraphicsPathItem)
642 };
643 
645 class Q_WIDGETS_EXPORT QGraphicsRectItem : public QAbstractGraphicsShapeItem
646 {
647 public:
648  explicit QGraphicsRectItem(QGraphicsItem *parent = nullptr);
649  explicit QGraphicsRectItem(const QRectF &rect, QGraphicsItem *parent = nullptr);
650  explicit QGraphicsRectItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent = nullptr);
652 
653  QRectF rect() const;
654  void setRect(const QRectF &rect);
655  inline void setRect(qreal x, qreal y, qreal w, qreal h);
656 
657  QRectF boundingRect() const override;
658  QPainterPath shape() const override;
659  bool contains(const QPointF &point) const override;
660 
661  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
662 
663  bool isObscuredBy(const QGraphicsItem *item) const override;
664  QPainterPath opaqueArea() const override;
665 
666  enum { Type = 3 };
667  int type() const override;
668 
669 protected:
670  bool supportsExtension(Extension extension) const override;
671  void setExtension(Extension extension, const QVariant &variant) override;
672  QVariant extension(const QVariant &variant) const override;
673 
674 private:
676  Q_DECLARE_PRIVATE(QGraphicsRectItem)
677 };
678 
680 { setRect(QRectF(ax, ay, w, h)); }
681 
683 class Q_WIDGETS_EXPORT QGraphicsEllipseItem : public QAbstractGraphicsShapeItem
684 {
685 public:
686  explicit QGraphicsEllipseItem(QGraphicsItem *parent = nullptr);
687  explicit QGraphicsEllipseItem(const QRectF &rect, QGraphicsItem *parent = nullptr);
688  explicit QGraphicsEllipseItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent = nullptr);
690 
691  QRectF rect() const;
692  void setRect(const QRectF &rect);
693  inline void setRect(qreal x, qreal y, qreal w, qreal h);
694 
695  int startAngle() const;
696  void setStartAngle(int angle);
697 
698  int spanAngle() const;
699  void setSpanAngle(int angle);
700 
701  QRectF boundingRect() const override;
702  QPainterPath shape() const override;
703  bool contains(const QPointF &point) const override;
704 
705  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
706 
707  bool isObscuredBy(const QGraphicsItem *item) const override;
708  QPainterPath opaqueArea() const override;
709 
710  enum { Type = 4 };
711  int type() const override;
712 
713 protected:
714  bool supportsExtension(Extension extension) const override;
715  void setExtension(Extension extension, const QVariant &variant) override;
716  QVariant extension(const QVariant &variant) const override;
717 
718 private:
720  Q_DECLARE_PRIVATE(QGraphicsEllipseItem)
721 };
722 
724 { setRect(QRectF(ax, ay, w, h)); }
725 
727 class Q_WIDGETS_EXPORT QGraphicsPolygonItem : public QAbstractGraphicsShapeItem
728 {
729 public:
730  explicit QGraphicsPolygonItem(QGraphicsItem *parent = nullptr);
731  explicit QGraphicsPolygonItem(const QPolygonF &polygon,
732  QGraphicsItem *parent = nullptr);
734 
735  QPolygonF polygon() const;
736  void setPolygon(const QPolygonF &polygon);
737 
738  Qt::FillRule fillRule() const;
739  void setFillRule(Qt::FillRule rule);
740 
741  QRectF boundingRect() const override;
742  QPainterPath shape() const override;
743  bool contains(const QPointF &point) const override;
744 
745  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
746 
747  bool isObscuredBy(const QGraphicsItem *item) const override;
748  QPainterPath opaqueArea() const override;
749 
750  enum { Type = 5 };
751  int type() const override;
752 
753 protected:
754  bool supportsExtension(Extension extension) const override;
755  void setExtension(Extension extension, const QVariant &variant) override;
756  QVariant extension(const QVariant &variant) const override;
757 
758 private:
760  Q_DECLARE_PRIVATE(QGraphicsPolygonItem)
761 };
762 
764 class Q_WIDGETS_EXPORT QGraphicsLineItem : public QGraphicsItem
765 {
766 public:
767  explicit QGraphicsLineItem(QGraphicsItem *parent = nullptr);
768  explicit QGraphicsLineItem(const QLineF &line, QGraphicsItem *parent = nullptr);
769  explicit QGraphicsLineItem(qreal x1, qreal y1, qreal x2, qreal y2, QGraphicsItem *parent = nullptr);
771 
772  QPen pen() const;
773  void setPen(const QPen &pen);
774 
775  QLineF line() const;
776  void setLine(const QLineF &line);
777  inline void setLine(qreal x1, qreal y1, qreal x2, qreal y2)
778  { setLine(QLineF(x1, y1, x2, y2)); }
779 
780  QRectF boundingRect() const override;
781  QPainterPath shape() const override;
782  bool contains(const QPointF &point) const override;
783 
784  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
785 
786  bool isObscuredBy(const QGraphicsItem *item) const override;
787  QPainterPath opaqueArea() const override;
788 
789  enum { Type = 6 };
790  int type() const override;
791 
792 protected:
793  bool supportsExtension(Extension extension) const override;
794  void setExtension(Extension extension, const QVariant &variant) override;
795  QVariant extension(const QVariant &variant) const override;
796 
797 private:
799  Q_DECLARE_PRIVATE(QGraphicsLineItem)
800 };
801 
803 class Q_WIDGETS_EXPORT QGraphicsPixmapItem : public QGraphicsItem
804 {
805 public:
806  enum ShapeMode {
809  HeuristicMaskShape
810  };
811 
812  explicit QGraphicsPixmapItem(QGraphicsItem *parent = nullptr);
813  explicit QGraphicsPixmapItem(const QPixmap &pixmap, QGraphicsItem *parent = nullptr);
815 
816  QPixmap pixmap() const;
817  void setPixmap(const QPixmap &pixmap);
818 
819  Qt::TransformationMode transformationMode() const;
820  void setTransformationMode(Qt::TransformationMode mode);
821 
822  QPointF offset() const;
823  void setOffset(const QPointF &offset);
824  inline void setOffset(qreal x, qreal y);
825 
826  QRectF boundingRect() const override;
827  QPainterPath shape() const override;
828  bool contains(const QPointF &point) const override;
829 
831 
832  bool isObscuredBy(const QGraphicsItem *item) const override;
833  QPainterPath opaqueArea() const override;
834 
835  enum { Type = 7 };
836  int type() const override;
837 
838  ShapeMode shapeMode() const;
839  void setShapeMode(ShapeMode mode);
840 
841 protected:
842  bool supportsExtension(Extension extension) const override;
843  void setExtension(Extension extension, const QVariant &variant) override;
844  QVariant extension(const QVariant &variant) const override;
845 
846 private:
848  Q_DECLARE_PRIVATE(QGraphicsPixmapItem)
849 };
850 
852 { setOffset(QPointF(ax, ay)); }
853 
855 class QTextDocument;
856 class QTextCursor;
857 class Q_WIDGETS_EXPORT QGraphicsTextItem : public QGraphicsObject
858 {
859  Q_OBJECT
860  QDOC_PROPERTY(bool openExternalLinks READ openExternalLinks WRITE setOpenExternalLinks)
861  QDOC_PROPERTY(QTextCursor textCursor READ textCursor WRITE setTextCursor)
862 
863 public:
864  explicit QGraphicsTextItem(QGraphicsItem *parent = nullptr);
865  explicit QGraphicsTextItem(const QString &text, QGraphicsItem *parent = nullptr);
867 
868  QString toHtml() const;
869  void setHtml(const QString &html);
870 
871  QString toPlainText() const;
872  void setPlainText(const QString &text);
873 
874  QFont font() const;
875  void setFont(const QFont &font);
876 
877  void setDefaultTextColor(const QColor &c);
878  QColor defaultTextColor() const;
879 
880  QRectF boundingRect() const override;
881  QPainterPath shape() const override;
882  bool contains(const QPointF &point) const override;
883 
885 
886  bool isObscuredBy(const QGraphicsItem *item) const override;
887  QPainterPath opaqueArea() const override;
888 
889  enum { Type = 8 };
890  int type() const override;
891 
892  void setTextWidth(qreal width);
893  qreal textWidth() const;
894 
895  void adjustSize();
896 
897  void setDocument(QTextDocument *document);
898  QTextDocument *document() const;
899 
900  void setTextInteractionFlags(Qt::TextInteractionFlags flags);
901  Qt::TextInteractionFlags textInteractionFlags() const;
902 
903  void setTabChangesFocus(bool b);
904  bool tabChangesFocus() const;
905 
906  void setOpenExternalLinks(bool open);
907  bool openExternalLinks() const;
908 
909  void setTextCursor(const QTextCursor &cursor);
910  QTextCursor textCursor() const;
911 
912 Q_SIGNALS:
913  void linkActivated(const QString &);
914  void linkHovered(const QString &);
915 
916 protected:
917  bool sceneEvent(QEvent *event) override;
918  void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
919  void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
920  void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
921  void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
922  void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
923  void keyPressEvent(QKeyEvent *event) override;
924  void keyReleaseEvent(QKeyEvent *event) override;
925  void focusInEvent(QFocusEvent *event) override;
926  void focusOutEvent(QFocusEvent *event) override;
927  void dragEnterEvent(QGraphicsSceneDragDropEvent *event) override;
928  void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) override;
929  void dragMoveEvent(QGraphicsSceneDragDropEvent *event) override;
930  void dropEvent(QGraphicsSceneDragDropEvent *event) override;
931  void inputMethodEvent(QInputMethodEvent *event) override;
932  void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
933  void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
934  void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
935 
936  QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
937 
938  bool supportsExtension(Extension extension) const override;
939  void setExtension(Extension extension, const QVariant &variant) override;
940  QVariant extension(const QVariant &variant) const override;
941 
942 private:
946 };
947 
950 {
951 public:
952  explicit QGraphicsSimpleTextItem(QGraphicsItem *parent = nullptr);
953  explicit QGraphicsSimpleTextItem(const QString &text, QGraphicsItem *parent = nullptr);
955 
956  void setText(const QString &text);
957  QString text() const;
958 
959  void setFont(const QFont &font);
960  QFont font() const;
961 
962  QRectF boundingRect() const override;
963  QPainterPath shape() const override;
964  bool contains(const QPointF &point) const override;
965 
967 
968  bool isObscuredBy(const QGraphicsItem *item) const override;
969  QPainterPath opaqueArea() const override;
970 
971  enum { Type = 9 };
972  int type() const override;
973 
974 protected:
975  bool supportsExtension(Extension extension) const override;
976  void setExtension(Extension extension, const QVariant &variant) override;
977  QVariant extension(const QVariant &variant) const override;
978 
979 private:
981  Q_DECLARE_PRIVATE(QGraphicsSimpleTextItem)
982 };
983 
985 class Q_WIDGETS_EXPORT QGraphicsItemGroup : public QGraphicsItem
986 {
987 public:
988  explicit QGraphicsItemGroup(QGraphicsItem *parent = nullptr);
990 
991  void addToGroup(QGraphicsItem *item);
992  void removeFromGroup(QGraphicsItem *item);
993 
994  QRectF boundingRect() const override;
995  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
996 
997  bool isObscuredBy(const QGraphicsItem *item) const override;
998  QPainterPath opaqueArea() const override;
999 
1000  enum { Type = 10 };
1001  int type() const override;
1002 
1003 private:
1005  Q_DECLARE_PRIVATE(QGraphicsItemGroup)
1006 };
1007 
1008 template <class T> inline T qgraphicsitem_cast(QGraphicsItem *item)
1009 {
1011  return int(Item::Type) == int(QGraphicsItem::Type)
1012  || (item && int(Item::Type) == item->type()) ? static_cast<T>(item) : 0;
1013 }
1014 
1015 template <class T> inline T qgraphicsitem_cast(const QGraphicsItem *item)
1016 {
1018  return int(Item::Type) == int(QGraphicsItem::Type)
1019  || (item && int(Item::Type) == item->type()) ? static_cast<T>(item) : 0;
1020 }
1021 
1022 #ifndef QT_NO_DEBUG_STREAM
1023 Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, const QGraphicsItem *item);
1024 Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, const QGraphicsObject *item);
1027 Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlags flags);
1028 #endif
1029 
1031 
1033 
1035 
1037 
1038 #endif // QGRAPHICSITEM_H
Definition: lalr.h:110
The QAbstractGraphicsShapeItem class provides a common base for all path items.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:66
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
The QCursor class provides a mouse cursor with an arbitrary shape.
Definition: qcursor.h:81
operator<<(QDataStream &ds, qfloat16 f)
Definition: qfloat16.cpp:327
The QDebug class provides an output stream for debugging information.
Definition: qdebug.h:65
The QEvent class is the base class of all event classes. Event objects contain event parameters.
Definition: qcoreevent.h:58
The QFocusEvent class contains event parameters for widget focus events. \inmodule QtGui.
Definition: qevent.h:520
The QFont class specifies a query for a font used for drawing text.
Definition: qfont.h:56
The QGraphicsEffect class is the base class for all graphics effects.
The QGraphicsEllipseItem class provides an ellipse item that you can add to a QGraphicsScene.
void setRect(const QRectF &rect)
The QGraphicsItemGroup class provides a container that treats a group of items as a single item.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
Definition: qgraphicsitem.h:83
void setTransformOriginPoint(qreal ax, qreal ay)
QRectF mapRectToItem(const QGraphicsItem *item, const QRectF &rect) const
@ ItemTransformOriginPointChange
@ ItemScenePositionHasChanged
QPointF mapToItem(const QGraphicsItem *item, const QPointF &point) const
QScopedPointer< QGraphicsItemPrivate > d_ptr
void ensureVisible(const QRectF &rect=QRectF(), int xmargin=50, int ymargin=50)
void update(const QRectF &rect=QRectF())
bool isObscured(const QRectF &rect=QRectF()) const
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr)=0
void moveBy(qreal dx, qreal dy)
qreal y() const
virtual QRectF boundingRect() const =0
QPointF mapFromItem(const QGraphicsItem *item, const QPointF &point) const
void setPos(const QPointF &pos)
QRectF mapRectToParent(const QRectF &rect) const
qreal x() const
QPointF mapToScene(const QPointF &point) const
QRectF mapRectToScene(const QRectF &rect) const
virtual int type() const
QPointF mapToParent(const QPointF &point) const
QRectF mapRectFromItem(const QGraphicsItem *item, const QRectF &rect) const
QRectF mapRectFromScene(const QRectF &rect) const
QPointF mapFromParent(const QPointF &point) const
QRectF mapRectFromParent(const QRectF &rect) const
T qgraphicsitem_cast(QGraphicsItem *item)
QPointF mapFromScene(const QPointF &point) const
The QGraphicsLineItem class provides a line item that you can add to a QGraphicsScene.
void setLine(qreal x1, qreal y1, qreal x2, qreal y2)
The QGraphicsObject class provides a base class for all graphics items that require signals,...
void heightChanged()
void visibleChanged()
void childrenChanged()
void rotationChanged()
void parentChanged()
void opacityChanged()
void enabledChanged()
int type() const override
The QGraphicsPixmapItem class provides a pixmap item that you can add to a QGraphicsScene.
void setOffset(const QPointF &offset)
The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene.
The QGraphicsRectItem class provides a rectangle item that you can add to a QGraphicsScene.
void setRect(const QRectF &rect)
The QGraphicsSceneBspTreeIndex class provides an implementation of a BSP indexing algorithm for disco...
The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework.
The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framewor...
The QGraphicsSceneEvent class provides a base class for all graphics view related events.
The QGraphicsSceneHoverEvent class provides hover events in the graphics view framework.
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
The QGraphicsSceneIndex class provides a base class to implement a custom indexing algorithm for disc...
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
The QGraphicsSceneWheelEvent class provides wheel events in the graphics view framework.
The QGraphicsSimpleTextItem class provides a simple text path item that you can add to a QGraphicsSce...
The QGraphicsTextItem class provides a text item that you can add to a QGraphicsScene to display form...
void linkHovered(const QString &)
void linkActivated(const QString &)
The QGraphicsTransform class is an abstract base class for building advanced transformations on QGrap...
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
Definition: qgraphicsview.h:60
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.
The QInputMethodEvent class provides parameters for input method events. \inmodule QtGui.
Definition: qevent.h:696
The QKeyEvent class describes a key event.
Definition: qevent.h:471
The QLineF class provides a two-dimensional vector using floating point precision.
Definition: qline.h:215
The QMenu class provides a menu widget for use in menu bars, context menus, and other popup menus.
Definition: qmenu.h:62
The QObject class is the base class of all Qt objects.
Definition: qobject.h:125
const QObjectList & children() const
Definition: qobject.h:206
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:82
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:65
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:61
The QPixmap class is an off-screen image representation that can be used as a paint device.
Definition: qpixmap.h:63
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:242
The QPolygonF class provides a list of points using floating point precision. \inmodule QtGui.
Definition: qpolygon.h:128
The QRectF class defines a finite rectangle in the plane using floating point precision.
Definition: qrect.h:511
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:63
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:55
The QString class provides a Unicode character string.
Definition: qstring.h:388
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
Definition: qstyleoption.h:684
The QTextCursor class offers an API to access and modify QTextDocuments.
Definition: qtextcursor.h:67
The QTextDocument class holds formatted text.
Definition: qtextdocument.h:93
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:56
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:95
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:133
float rotation
QOpenGLWidget * widget
[1]
QDomDocument document
[0]
QPainter paint
QCursor cursor
set contains("Julia")
rect
[4]
InputMethodQuery
Definition: qnamespace.h:1380
TransformationMode
Definition: qnamespace.h:1349
ItemSelectionMode
Definition: qnamespace.h:1337
@ IntersectsItemShape
Definition: qnamespace.h:1339
GestureType
Definition: qnamespace.h:1641
FillRule
Definition: qnamespace.h:1320
@ ItemIsSelectable
Definition: qnamespace.h:1532
FocusReason
Definition: qnamespace.h:1360
@ OtherFocusReason
Definition: qnamespace.h:1368
Definition: brush.cpp:52
DBusConnection const char * rule
EGLOutputLayerEXT EGLint EGLAttrib value
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition: qflags.h:210
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition: qflags.h:227
QT_END_INCLUDE_NAMESPACE typedef double qreal
Definition: qglobal.h:341
#define Q_DISABLE_COPY(Class)
Definition: qglobal.h:515
QT_REQUIRE_CONFIG(graphicsview)
bool qt_closestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2)
bool qt_closestItemFirst(const QGraphicsItem *item1, const QGraphicsItem *item2)
@ text
#define Q_DECLARE_METATYPE(TYPE)
Definition: qmetatype.h:1417
#define Q_DECLARE_INTERFACE(IFace, IId)
Definition: qobject.h:504
GLenum type
Definition: qopengl.h:270
GLboolean GLboolean GLboolean b
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLenum mode
GLuint64 key
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLuint GLfloat GLfloat GLfloat GLfloat y1
GLuint GLfloat GLfloat GLfloat x1
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLsizei width
GLboolean GLuint group
GLfloat angle
GLbitfield flags
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLint y
GLfloat GLfloat GLfloat GLfloat h
struct _cl_event * event
Definition: qopenglext.h:2998
GLuint GLenum GLenum transform
Definition: qopenglext.h:11564
GLenum query
Definition: qopenglext.h:2738
const GLubyte * c
Definition: qopenglext.h:12701
GLfixed GLfixed GLfixed y2
Definition: qopenglext.h:5231
GLuint GLenum matrix
Definition: qopenglext.h:11564
GLfixed GLfixed x2
Definition: qopenglext.h:5231
GLsizei const GLchar *const * path
Definition: qopenglext.h:4283
GLuint GLenum option
Definition: qopenglext.h:5929
GLenum GLenum GLenum GLenum GLenum scale
Definition: qopenglext.h:10817
#define Q_PROPERTY(...)
Definition: qtmetamacros.h:92
#define Q_OBJECT
Definition: qtmetamacros.h:158
#define Q_CLASSINFO(name, value)
Definition: qtmetamacros.h:88
#define Q_INTERFACES(x)
Definition: qtmetamacros.h:91
#define Q_SLOTS
Definition: qtmetamacros.h:80
#define QDOC_PROPERTY(text)
Definition: qtmetamacros.h:98
#define Q_SIGNALS
Definition: qtmetamacros.h:81
#define Q_PRIVATE_PROPERTY(d, text)
Definition: qtmetamacros.h:93
QWidget * panel
Definition: settings.cpp:54
file open(QIODevice::ReadOnly)
mimeData setData("text/csv", csvData)
MyClass setText
QVariant variant
[1]
p setX(p.x()+1)
QSharedPointer< T > other(t)
[5]
QGraphicsOpacityEffect * effect
QGraphicsScene scene
[0]
item setTransform(QTransform().translate(x, y).rotate(45).translate(-x, -y))
line installSceneEventFilter(ellipse)
rect sceneTransform().map(QPointF(0
item setCursor(Qt::IBeamCursor)
[1]
QGraphicsItem * item
rect setPos(100, 100)
rect deviceTransform(view->viewportTransform()).map(QPointF(0
edit isVisible()
view setCacheMode(QGraphicsView::CacheBackground)
QLayoutItem * child
[0]
widget render & pixmap
QPainter painter(this)
[7]
setFont(font)
aWidget window() -> setWindowTitle("New Window Title")
[2]
edit textCursor().insertText(text)
[0]
imageLabel setPixmap(QPixmap::fromImage(image))
backaction setToolTip(browser.historyTitle(-1))
[0]
content text html
Definition: main.cpp:38
Definition: moc.h:48
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent