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
qgraphicsitem.h
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#ifndef QGRAPHICSITEM_H
5#define QGRAPHICSITEM_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtCore/qobject.h>
9#include <QtCore/qvariant.h>
10#include <QtCore/qrect.h>
11#include <QtCore/qscopedpointer.h>
12#include <QtGui/qpainterpath.h>
13#include <QtGui/qpixmap.h>
14
15class tst_QGraphicsItem;
16
17QT_REQUIRE_CONFIG(graphicsview);
18
20
21class QBrush;
22class QCursor;
23class QFocusEvent;
24class QGraphicsEffect;
26class QGraphicsObject;
33class QGraphicsScene;
35class QGraphicsWidget;
37class QKeyEvent;
38class QMenu;
39class QPainter;
40class QPen;
41class QPointF;
42class QRectF;
44
46class Q_WIDGETS_EXPORT QGraphicsItem
47{
48public:
50 ItemIsMovable = 0x1,
51 ItemIsSelectable = 0x2,
52 ItemIsFocusable = 0x4,
53 ItemClipsToShape = 0x8,
54 ItemClipsChildrenToShape = 0x10,
55 ItemIgnoresTransformations = 0x20,
56 ItemIgnoresParentOpacity = 0x40,
57 ItemDoesntPropagateOpacityToChildren = 0x80,
58 ItemStacksBehindParent = 0x100,
59 ItemUsesExtendedStyleOption = 0x200,
60 ItemHasNoContents = 0x400,
61 ItemSendsGeometryChanges = 0x800,
62 ItemAcceptsInputMethod = 0x1000,
63 ItemNegativeZStacksBehindParent = 0x2000,
64 ItemIsPanel = 0x4000,
65 ItemIsFocusScope = 0x8000, // internal
66 ItemSendsScenePositionChanges = 0x10000,
67 ItemStopsClickFocusPropagation = 0x20000,
68 ItemStopsFocusHandling = 0x40000,
69 ItemContainsChildrenInShape = 0x80000
70 // NB! Don't forget to increase the d_ptr->flags bit field by 1 when adding a new flag.
71 };
72 Q_DECLARE_FLAGS(GraphicsItemFlags, GraphicsItemFlag)
73
109
113 DeviceCoordinateCache
114 };
115
117 {
120 SceneModal
121 };
122
123 explicit QGraphicsItem(QGraphicsItem *parent = nullptr);
124 virtual ~QGraphicsItem();
125
126 QGraphicsScene *scene() const;
127
128 QGraphicsItem *parentItem() const;
129 QGraphicsItem *topLevelItem() const;
130 QGraphicsObject *parentObject() const;
131 QGraphicsWidget *parentWidget() const;
132 QGraphicsWidget *topLevelWidget() const;
133 QGraphicsWidget *window() const;
134 QGraphicsItem *panel() const;
135 void setParentItem(QGraphicsItem *parent);
136 QList<QGraphicsItem *> childItems() const;
137 bool isWidget() const;
138 bool isWindow() const;
139 bool isPanel() const;
140
141 QGraphicsObject *toGraphicsObject();
142 const QGraphicsObject *toGraphicsObject() const;
143
144 QGraphicsItemGroup *group() const;
145 void setGroup(QGraphicsItemGroup *group);
146
147 GraphicsItemFlags flags() const;
148 void setFlag(GraphicsItemFlag flag, bool enabled = true);
149 void setFlags(GraphicsItemFlags flags);
150
151 CacheMode cacheMode() const;
152 void setCacheMode(CacheMode mode, const QSize &cacheSize = QSize());
153
154 PanelModality panelModality() const;
155 void setPanelModality(PanelModality panelModality);
156 bool isBlockedByModalPanel(QGraphicsItem **blockingPanel = nullptr) const;
157
158#if QT_CONFIG(tooltip)
159 QString toolTip() const;
160 void setToolTip(const QString &toolTip);
161#endif
162
163#ifndef QT_NO_CURSOR
164 QCursor cursor() const;
165 void setCursor(const QCursor &cursor);
166 bool hasCursor() const;
167 void unsetCursor();
168#endif
169
170 bool isVisible() const;
171 bool isVisibleTo(const QGraphicsItem *parent) const;
172 void setVisible(bool visible);
173 inline void hide() { setVisible(false); }
174 inline void show() { setVisible(true); }
175
176 bool isEnabled() const;
177 void setEnabled(bool enabled);
178
179 bool isSelected() const;
180 void setSelected(bool selected);
181
182 bool acceptDrops() const;
183 void setAcceptDrops(bool on);
184
185 qreal opacity() const;
186 qreal effectiveOpacity() const;
187 void setOpacity(qreal opacity);
188
189#if QT_CONFIG(graphicseffect)
190 // Effect
191 QGraphicsEffect *graphicsEffect() const;
192 void setGraphicsEffect(QGraphicsEffect *effect);
193#endif // QT_CONFIG(graphicseffect)
194
195 Qt::MouseButtons acceptedMouseButtons() const;
196 void setAcceptedMouseButtons(Qt::MouseButtons buttons);
197 bool acceptHoverEvents() const;
198 void setAcceptHoverEvents(bool enabled);
199 bool acceptTouchEvents() const;
200 void setAcceptTouchEvents(bool enabled);
201
202 bool filtersChildEvents() const;
203 void setFiltersChildEvents(bool enabled);
204
205 bool handlesChildEvents() const;
206 void setHandlesChildEvents(bool enabled);
207
208 bool isActive() const;
209 void setActive(bool active);
210
211 bool hasFocus() const;
212 void setFocus(Qt::FocusReason focusReason = Qt::OtherFocusReason);
213 void clearFocus();
214
215 QGraphicsItem *focusProxy() const;
216 void setFocusProxy(QGraphicsItem *item);
217
218 QGraphicsItem *focusItem() const;
219 QGraphicsItem *focusScopeItem() const;
220
221 void grabMouse();
222 void ungrabMouse();
223 void grabKeyboard();
224 void ungrabKeyboard();
225
226 // Positioning in scene coordinates
227 QPointF pos() const;
228 inline qreal x() const { return pos().x(); }
229 void setX(qreal x);
230 inline qreal y() const { return pos().y(); }
231 void setY(qreal y);
232 QPointF scenePos() const;
233 void setPos(const QPointF &pos);
234 inline void setPos(qreal x, qreal y);
235 inline void moveBy(qreal dx, qreal dy) { setPos(pos().x() + dx, pos().y() + dy); }
236
237 void ensureVisible(const QRectF &rect = QRectF(), int xmargin = 50, int ymargin = 50);
238 inline void ensureVisible(qreal x, qreal y, qreal w, qreal h, int xmargin = 50, int ymargin = 50);
239
240 // Local transformation
241 QTransform transform() const;
243 QTransform deviceTransform(const QTransform &viewportTransform) const;
244 QTransform itemTransform(const QGraphicsItem *other, bool *ok = nullptr) const;
245 void setTransform(const QTransform &matrix, bool combine = false);
246 void resetTransform();
247 void setRotation(qreal angle);
248 qreal rotation() const;
249
250 void setScale(qreal scale);
251 qreal scale() const;
252
253 QList<QGraphicsTransform *> transformations() const;
254 void setTransformations(const QList<QGraphicsTransform *> &transformations);
255
256 QPointF transformOriginPoint() const;
257 void setTransformOriginPoint(const QPointF &origin);
259 { setTransformOriginPoint(QPointF(ax,ay)); }
260
261 virtual void advance(int phase);
262
263 // Stacking order
264 qreal zValue() const;
265 void setZValue(qreal z);
266 void stackBefore(const QGraphicsItem *sibling);
267
268 // Hit test
269 virtual QRectF boundingRect() const = 0;
270 QRectF childrenBoundingRect() const;
271 QRectF sceneBoundingRect() const;
272 virtual QPainterPath shape() const;
273 bool isClipped() const;
274 QPainterPath clipPath() const;
275 virtual bool contains(const QPointF &point) const;
276 virtual bool collidesWithItem(const QGraphicsItem *other, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
277 virtual bool collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
278 QList<QGraphicsItem *> collidingItems(Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
279 bool isObscured(const QRectF &rect = QRectF()) const;
280 inline bool isObscured(qreal x, qreal y, qreal w, qreal h) const;
281 virtual bool isObscuredBy(const QGraphicsItem *item) const;
282 virtual QPainterPath opaqueArea() const;
283
284 QRegion boundingRegion(const QTransform &itemToDeviceTransform) const;
285 qreal boundingRegionGranularity() const;
286 void setBoundingRegionGranularity(qreal granularity);
287
288 // Drawing
289 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) = 0;
290 void update(const QRectF &rect = QRectF());
291 inline void update(qreal x, qreal y, qreal width, qreal height);
292 void scroll(qreal dx, qreal dy, const QRectF &rect = QRectF());
293
294 // Coordinate mapping
295 QPointF mapToItem(const QGraphicsItem *item, const QPointF &point) const;
296 QPointF mapToParent(const QPointF &point) const;
297 QPointF mapToScene(const QPointF &point) const;
298 QPolygonF mapToItem(const QGraphicsItem *item, const QRectF &rect) const;
299 QPolygonF mapToParent(const QRectF &rect) const;
300 QPolygonF mapToScene(const QRectF &rect) const;
301 QRectF mapRectToItem(const QGraphicsItem *item, const QRectF &rect) const;
302 QRectF mapRectToParent(const QRectF &rect) const;
303 QRectF mapRectToScene(const QRectF &rect) const;
304 QPolygonF mapToItem(const QGraphicsItem *item, const QPolygonF &polygon) const;
305 QPolygonF mapToParent(const QPolygonF &polygon) const;
306 QPolygonF mapToScene(const QPolygonF &polygon) const;
307 QPainterPath mapToItem(const QGraphicsItem *item, const QPainterPath &path) const;
308 QPainterPath mapToParent(const QPainterPath &path) const;
309 QPainterPath mapToScene(const QPainterPath &path) const;
310 QPointF mapFromItem(const QGraphicsItem *item, const QPointF &point) const;
311 QPointF mapFromParent(const QPointF &point) const;
312 QPointF mapFromScene(const QPointF &point) const;
313 QPolygonF mapFromItem(const QGraphicsItem *item, const QRectF &rect) const;
314 QPolygonF mapFromParent(const QRectF &rect) const;
315 QPolygonF mapFromScene(const QRectF &rect) const;
316 QRectF mapRectFromItem(const QGraphicsItem *item, const QRectF &rect) const;
317 QRectF mapRectFromParent(const QRectF &rect) const;
318 QRectF mapRectFromScene(const QRectF &rect) const;
319 QPolygonF mapFromItem(const QGraphicsItem *item, const QPolygonF &polygon) const;
320 QPolygonF mapFromParent(const QPolygonF &polygon) const;
321 QPolygonF mapFromScene(const QPolygonF &polygon) const;
322 QPainterPath mapFromItem(const QGraphicsItem *item, const QPainterPath &path) const;
323 QPainterPath mapFromParent(const QPainterPath &path) const;
324 QPainterPath mapFromScene(const QPainterPath &path) const;
325
326 inline QPointF mapToItem(const QGraphicsItem *item, qreal x, qreal y) const;
327 inline QPointF mapToParent(qreal x, qreal y) const;
328 inline QPointF mapToScene(qreal x, qreal y) const;
329 inline QPolygonF mapToItem(const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const;
330 inline QPolygonF mapToParent(qreal x, qreal y, qreal w, qreal h) const;
331 inline QPolygonF mapToScene(qreal x, qreal y, qreal w, qreal h) const;
332 inline QRectF mapRectToItem(const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const;
333 inline QRectF mapRectToParent(qreal x, qreal y, qreal w, qreal h) const;
334 inline QRectF mapRectToScene(qreal x, qreal y, qreal w, qreal h) const;
335 inline QPointF mapFromItem(const QGraphicsItem *item, qreal x, qreal y) const;
336 inline QPointF mapFromParent(qreal x, qreal y) const;
337 inline QPointF mapFromScene(qreal x, qreal y) const;
338 inline QPolygonF mapFromItem(const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const;
339 inline QPolygonF mapFromParent(qreal x, qreal y, qreal w, qreal h) const;
340 inline QPolygonF mapFromScene(qreal x, qreal y, qreal w, qreal h) const;
341 inline QRectF mapRectFromItem(const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const;
342 inline QRectF mapRectFromParent(qreal x, qreal y, qreal w, qreal h) const;
343 inline QRectF mapRectFromScene(qreal x, qreal y, qreal w, qreal h) const;
344
345 bool isAncestorOf(const QGraphicsItem *child) const;
346 QGraphicsItem *commonAncestorItem(const QGraphicsItem *other) const;
347 bool isUnderMouse() const;
348
349 // Custom data
350 QVariant data(int key) const;
351 void setData(int key, const QVariant &value);
352
353 Qt::InputMethodHints inputMethodHints() const;
354 void setInputMethodHints(Qt::InputMethodHints hints);
355
356 enum {
357 Type = 1,
358 UserType = 65536
359 };
360 virtual int type() const;
361
362 void installSceneEventFilter(QGraphicsItem *filterItem);
363 void removeSceneEventFilter(QGraphicsItem *filterItem);
364
365protected:
366 void updateMicroFocus();
367 virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
368 virtual bool sceneEvent(QEvent *event);
369 virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
370 virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
371 virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
372 virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *event);
373 virtual void dropEvent(QGraphicsSceneDragDropEvent *event);
374 virtual void focusInEvent(QFocusEvent *event);
375 virtual void focusOutEvent(QFocusEvent *event);
376 virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
377 virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
378 virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
379 virtual void keyPressEvent(QKeyEvent *event);
380 virtual void keyReleaseEvent(QKeyEvent *event);
381 virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
382 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
383 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
384 virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
385 virtual void wheelEvent(QGraphicsSceneWheelEvent *event);
386 virtual void inputMethodEvent(QInputMethodEvent *event);
387 virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
388
389 virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
390
392 UserExtension = 0x80000000
393 };
394 virtual bool supportsExtension(Extension extension) const;
395 virtual void setExtension(Extension extension, const QVariant &variant);
396 virtual QVariant extension(const QVariant &variant) const;
397
398protected:
400 QScopedPointer<QGraphicsItemPrivate> d_ptr;
401
402 void addToIndex();
403 void removeFromIndex();
404 void prepareGeometryChange();
405
406private:
407 Q_DISABLE_COPY(QGraphicsItem)
408 Q_DECLARE_PRIVATE(QGraphicsItem)
409 friend class QGraphicsItemGroup;
410 friend class QGraphicsScene;
412 friend class QGraphicsSceneFindItemBspTreeVisitor;
414 friend class QGraphicsView;
416 friend class QGraphicsObject;
417 friend class QGraphicsWidget;
424 friend class QGraphicsItemEffectSourcePrivate;
426#ifndef QT_NO_GESTURES
427 friend class QGestureManager;
428#endif
429 friend class ::tst_QGraphicsItem;
430 friend bool qt_closestLeaf(const QGraphicsItem *, const QGraphicsItem *);
431 friend bool qt_closestItemFirst(const QGraphicsItem *, const QGraphicsItem *);
432};
433
434Q_DECLARE_OPERATORS_FOR_FLAGS(QGraphicsItem::GraphicsItemFlags)
435#ifndef Q_QDOC
436Q_DECLARE_INTERFACE(QGraphicsItem, "org.qt-project.Qt.QGraphicsItem")
437#endif
438
440{ setPos(QPointF(ax, ay)); }
441inline void QGraphicsItem::ensureVisible(qreal ax, qreal ay, qreal w, qreal h, int xmargin, int ymargin)
442{ ensureVisible(QRectF(ax, ay, w, h), xmargin, ymargin); }
445inline bool QGraphicsItem::isObscured(qreal ax, qreal ay, qreal w, qreal h) const
446{ return isObscured(QRectF(ax, ay, w, h)); }
448{ return mapToItem(item, QPointF(ax, ay)); }
450{ return mapToParent(QPointF(ax, ay)); }
452{ return mapToScene(QPointF(ax, ay)); }
454{ return mapFromItem(item, QPointF(ax, ay)); }
456{ return mapFromParent(QPointF(ax, ay)); }
458{ return mapFromScene(QPointF(ax, ay)); }
460{ return mapToItem(item, QRectF(ax, ay, w, h)); }
462{ return mapToParent(QRectF(ax, ay, w, h)); }
464{ return mapToScene(QRectF(ax, ay, w, h)); }
466{ return mapRectToItem(item, QRectF(ax, ay, w, h)); }
468{ return mapRectToParent(QRectF(ax, ay, w, h)); }
470{ return mapRectToScene(QRectF(ax, ay, w, h)); }
472{ return mapFromItem(item, QRectF(ax, ay, w, h)); }
474{ return mapFromParent(QRectF(ax, ay, w, h)); }
476{ return mapFromScene(QRectF(ax, ay, w, h)); }
478{ return mapRectFromItem(item, QRectF(ax, ay, w, h)); }
480{ return mapRectFromParent(QRectF(ax, ay, w, h)); }
482{ return mapRectFromScene(QRectF(ax, ay, w, h)); }
483
484
485class Q_WIDGETS_EXPORT QGraphicsObject : public QObject, public QGraphicsItem
486{
488 Q_PROPERTY(QGraphicsObject* parent READ parentObject WRITE setParentItem NOTIFY parentChanged
489 DESIGNABLE false)
490 Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged FINAL)
491 Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
492 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL)
493 Q_PROPERTY(QPointF pos READ pos WRITE setPos FINAL)
494 Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged FINAL)
495 Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged FINAL)
496 Q_PROPERTY(qreal z READ zValue WRITE setZValue NOTIFY zChanged FINAL)
497 Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged)
498 Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged)
499 Q_PROPERTY(QPointF transformOriginPoint READ transformOriginPoint WRITE setTransformOriginPoint)
500#if QT_CONFIG(graphicseffect)
501 Q_PROPERTY(QGraphicsEffect *effect READ graphicsEffect WRITE setGraphicsEffect)
502#endif
503 Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), qreal width READ width WRITE setWidth
504 NOTIFY widthChanged RESET resetWidth FINAL)
505 Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), qreal height READ height WRITE setHeight
506 NOTIFY heightChanged RESET resetHeight FINAL)
508public:
509 explicit QGraphicsObject(QGraphicsItem *parent = nullptr);
511
512 using QObject::children;
513
514#ifndef QT_NO_GESTURES
515 void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags());
516 void ungrabGesture(Qt::GestureType type);
517#endif
518
519protected Q_SLOTS:
520 void updateMicroFocus();
521
527 void xChanged();
528 void yChanged();
529 void zChanged();
535
536protected:
538
539 bool event(QEvent *ev) override;
540
541private:
542 friend class QGraphicsItem;
544};
545
546
548class Q_WIDGETS_EXPORT QAbstractGraphicsShapeItem : public QGraphicsItem
549{
550public:
551 explicit QAbstractGraphicsShapeItem(QGraphicsItem *parent = nullptr);
553
554 QPen pen() const;
555 void setPen(const QPen &pen);
556
557 QBrush brush() const;
558 void setBrush(const QBrush &brush);
559
560 bool isObscuredBy(const QGraphicsItem *item) const override;
561 QPainterPath opaqueArea() const override;
562
563protected:
565 QGraphicsItem *parent);
566
567private:
568 Q_DISABLE_COPY(QAbstractGraphicsShapeItem)
569 Q_DECLARE_PRIVATE(QAbstractGraphicsShapeItem)
570};
571
573class Q_WIDGETS_EXPORT QGraphicsPathItem : public QAbstractGraphicsShapeItem
574{
575public:
576 explicit QGraphicsPathItem(QGraphicsItem *parent = nullptr);
577 explicit QGraphicsPathItem(const QPainterPath &path, QGraphicsItem *parent = nullptr);
579
580 QPainterPath path() const;
581 void setPath(const QPainterPath &path);
582
583 QRectF boundingRect() const override;
584 QPainterPath shape() const override;
585 bool contains(const QPointF &point) const override;
586
587 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
588
589 bool isObscuredBy(const QGraphicsItem *item) const override;
590 QPainterPath opaqueArea() const override;
591
592 enum { Type = 2 };
593 int type() const override;
594
595protected:
596 bool supportsExtension(Extension extension) const override;
597 void setExtension(Extension extension, const QVariant &variant) override;
598 QVariant extension(const QVariant &variant) const override;
599
600private:
601 Q_DISABLE_COPY(QGraphicsPathItem)
602 Q_DECLARE_PRIVATE(QGraphicsPathItem)
603};
604
606class Q_WIDGETS_EXPORT QGraphicsRectItem : public QAbstractGraphicsShapeItem
607{
608public:
609 explicit QGraphicsRectItem(QGraphicsItem *parent = nullptr);
610 explicit QGraphicsRectItem(const QRectF &rect, QGraphicsItem *parent = nullptr);
611 explicit QGraphicsRectItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent = nullptr);
613
614 QRectF rect() const;
615 void setRect(const QRectF &rect);
616 inline void setRect(qreal x, qreal y, qreal w, qreal h);
617
618 QRectF boundingRect() const override;
619 QPainterPath shape() const override;
620 bool contains(const QPointF &point) const override;
621
622 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
623
624 bool isObscuredBy(const QGraphicsItem *item) const override;
625 QPainterPath opaqueArea() const override;
626
627 enum { Type = 3 };
628 int type() const override;
629
630protected:
631 bool supportsExtension(Extension extension) const override;
632 void setExtension(Extension extension, const QVariant &variant) override;
633 QVariant extension(const QVariant &variant) const override;
634
635private:
636 Q_DISABLE_COPY(QGraphicsRectItem)
637 Q_DECLARE_PRIVATE(QGraphicsRectItem)
638};
639
641{ setRect(QRectF(ax, ay, w, h)); }
642
645{
646public:
647 explicit QGraphicsEllipseItem(QGraphicsItem *parent = nullptr);
648 explicit QGraphicsEllipseItem(const QRectF &rect, QGraphicsItem *parent = nullptr);
649 explicit QGraphicsEllipseItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent = nullptr);
651
652 QRectF rect() const;
653 void setRect(const QRectF &rect);
654 inline void setRect(qreal x, qreal y, qreal w, qreal h);
655
656 int startAngle() const;
657 void setStartAngle(int angle);
658
659 int spanAngle() const;
660 void setSpanAngle(int angle);
661
662 QRectF boundingRect() const override;
663 QPainterPath shape() const override;
664 bool contains(const QPointF &point) const override;
665
666 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
667
668 bool isObscuredBy(const QGraphicsItem *item) const override;
669 QPainterPath opaqueArea() const override;
670
671 enum { Type = 4 };
672 int type() const override;
673
674protected:
675 bool supportsExtension(Extension extension) const override;
676 void setExtension(Extension extension, const QVariant &variant) override;
677 QVariant extension(const QVariant &variant) const override;
678
679private:
680 Q_DISABLE_COPY(QGraphicsEllipseItem)
681 Q_DECLARE_PRIVATE(QGraphicsEllipseItem)
682};
683
685{ setRect(QRectF(ax, ay, w, h)); }
686
689{
690public:
691 explicit QGraphicsPolygonItem(QGraphicsItem *parent = nullptr);
692 explicit QGraphicsPolygonItem(const QPolygonF &polygon,
693 QGraphicsItem *parent = nullptr);
695
696 QPolygonF polygon() const;
697 void setPolygon(const QPolygonF &polygon);
698
699 Qt::FillRule fillRule() const;
700 void setFillRule(Qt::FillRule rule);
701
702 QRectF boundingRect() const override;
703 QPainterPath shape() const override;
704 bool contains(const QPointF &point) const override;
705
706 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
707
708 bool isObscuredBy(const QGraphicsItem *item) const override;
709 QPainterPath opaqueArea() const override;
710
711 enum { Type = 5 };
712 int type() const override;
713
714protected:
715 bool supportsExtension(Extension extension) const override;
716 void setExtension(Extension extension, const QVariant &variant) override;
717 QVariant extension(const QVariant &variant) const override;
718
719private:
720 Q_DISABLE_COPY(QGraphicsPolygonItem)
721 Q_DECLARE_PRIVATE(QGraphicsPolygonItem)
722};
723
725class Q_WIDGETS_EXPORT QGraphicsLineItem : public QGraphicsItem
726{
727public:
728 explicit QGraphicsLineItem(QGraphicsItem *parent = nullptr);
729 explicit QGraphicsLineItem(const QLineF &line, QGraphicsItem *parent = nullptr);
730 explicit QGraphicsLineItem(qreal x1, qreal y1, qreal x2, qreal y2, QGraphicsItem *parent = nullptr);
732
733 QPen pen() const;
734 void setPen(const QPen &pen);
735
736 QLineF line() const;
737 void setLine(const QLineF &line);
739 { setLine(QLineF(x1, y1, x2, y2)); }
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 = 6 };
751 int type() const override;
752
753protected:
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
758private:
759 Q_DISABLE_COPY(QGraphicsLineItem)
760 Q_DECLARE_PRIVATE(QGraphicsLineItem)
761};
762
764class Q_WIDGETS_EXPORT QGraphicsPixmapItem : public QGraphicsItem
765{
766public:
770 HeuristicMaskShape
771 };
772
773 explicit QGraphicsPixmapItem(QGraphicsItem *parent = nullptr);
774 explicit QGraphicsPixmapItem(const QPixmap &pixmap, QGraphicsItem *parent = nullptr);
776
777 QPixmap pixmap() const;
778 void setPixmap(const QPixmap &pixmap);
779
780 Qt::TransformationMode transformationMode() const;
781 void setTransformationMode(Qt::TransformationMode mode);
782
783 QPointF offset() const;
784 void setOffset(const QPointF &offset);
785 inline void setOffset(qreal x, qreal y);
786
787 QRectF boundingRect() const override;
788 QPainterPath shape() const override;
789 bool contains(const QPointF &point) const override;
790
792
793 bool isObscuredBy(const QGraphicsItem *item) const override;
794 QPainterPath opaqueArea() const override;
795
796 enum { Type = 7 };
797 int type() const override;
798
799 ShapeMode shapeMode() const;
800 void setShapeMode(ShapeMode mode);
801
802protected:
803 bool supportsExtension(Extension extension) const override;
804 void setExtension(Extension extension, const QVariant &variant) override;
805 QVariant extension(const QVariant &variant) const override;
806
807private:
808 Q_DISABLE_COPY(QGraphicsPixmapItem)
809 Q_DECLARE_PRIVATE(QGraphicsPixmapItem)
810};
811
813{ setOffset(QPointF(ax, ay)); }
814
816class QTextDocument;
817class QTextCursor;
818class Q_WIDGETS_EXPORT QGraphicsTextItem : public QGraphicsObject
819{
821 QDOC_PROPERTY(bool openExternalLinks READ openExternalLinks WRITE setOpenExternalLinks)
822 QDOC_PROPERTY(QTextCursor textCursor READ textCursor WRITE setTextCursor)
823
824public:
825 explicit QGraphicsTextItem(QGraphicsItem *parent = nullptr);
826 explicit QGraphicsTextItem(const QString &text, QGraphicsItem *parent = nullptr);
828
829 QString toHtml() const;
830 void setHtml(const QString &html);
831
832 QString toPlainText() const;
833 void setPlainText(const QString &text);
834
835 QFont font() const;
836 void setFont(const QFont &font);
837
838 void setDefaultTextColor(const QColor &c);
839 QColor defaultTextColor() const;
840
841 QRectF boundingRect() const override;
842 QPainterPath shape() const override;
843 bool contains(const QPointF &point) const override;
844
846
847 bool isObscuredBy(const QGraphicsItem *item) const override;
848 QPainterPath opaqueArea() const override;
849
850 enum { Type = 8 };
851 int type() const override;
852
853 void setTextWidth(qreal width);
854 qreal textWidth() const;
855
856 void adjustSize();
857
858 void setDocument(QTextDocument *document);
859 QTextDocument *document() const;
860
861 void setTextInteractionFlags(Qt::TextInteractionFlags flags);
862 Qt::TextInteractionFlags textInteractionFlags() const;
863
864 void setTabChangesFocus(bool b);
865 bool tabChangesFocus() const;
866
867 void setOpenExternalLinks(bool open);
868 bool openExternalLinks() const;
869
870 void setTextCursor(const QTextCursor &cursor);
871 QTextCursor textCursor() const;
872
874 void linkActivated(const QString &);
875 void linkHovered(const QString &);
876
877protected:
878 bool sceneEvent(QEvent *event) override;
879 void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
880 void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
881 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
882 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
883 void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
884 void keyPressEvent(QKeyEvent *event) override;
885 void keyReleaseEvent(QKeyEvent *event) override;
886 void focusInEvent(QFocusEvent *event) override;
887 void focusOutEvent(QFocusEvent *event) override;
888 void dragEnterEvent(QGraphicsSceneDragDropEvent *event) override;
889 void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) override;
890 void dragMoveEvent(QGraphicsSceneDragDropEvent *event) override;
891 void dropEvent(QGraphicsSceneDragDropEvent *event) override;
892 void inputMethodEvent(QInputMethodEvent *event) override;
893 void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
894 void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
895 void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
896
897 QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
898
899 bool supportsExtension(Extension extension) const override;
900 void setExtension(Extension extension, const QVariant &variant) override;
901 QVariant extension(const QVariant &variant) const override;
902
903private:
904 Q_DISABLE_COPY(QGraphicsTextItem)
907};
908
911{
912public:
913 explicit QGraphicsSimpleTextItem(QGraphicsItem *parent = nullptr);
914 explicit QGraphicsSimpleTextItem(const QString &text, QGraphicsItem *parent = nullptr);
916
917 void setText(const QString &text);
918 QString text() const;
919
920 void setFont(const QFont &font);
921 QFont font() const;
922
923 QRectF boundingRect() const override;
924 QPainterPath shape() const override;
925 bool contains(const QPointF &point) const override;
926
928
929 bool isObscuredBy(const QGraphicsItem *item) const override;
930 QPainterPath opaqueArea() const override;
931
932 enum { Type = 9 };
933 int type() const override;
934
935protected:
936 bool supportsExtension(Extension extension) const override;
937 void setExtension(Extension extension, const QVariant &variant) override;
938 QVariant extension(const QVariant &variant) const override;
939
940private:
941 Q_DISABLE_COPY(QGraphicsSimpleTextItem)
942 Q_DECLARE_PRIVATE(QGraphicsSimpleTextItem)
943};
944
946class Q_WIDGETS_EXPORT QGraphicsItemGroup : public QGraphicsItem
947{
948public:
949 explicit QGraphicsItemGroup(QGraphicsItem *parent = nullptr);
951
952 void addToGroup(QGraphicsItem *item);
953 void removeFromGroup(QGraphicsItem *item);
954
955 QRectF boundingRect() const override;
956 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
957
958 bool isObscuredBy(const QGraphicsItem *item) const override;
959 QPainterPath opaqueArea() const override;
960
961 enum { Type = 10 };
962 int type() const override;
963
964private:
965 Q_DISABLE_COPY(QGraphicsItemGroup)
966 Q_DECLARE_PRIVATE(QGraphicsItemGroup)
967};
968
969template <class T> inline T qgraphicsitem_cast(QGraphicsItem *item)
970{
971 typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type Item;
972 return int(Item::Type) == int(QGraphicsItem::Type)
973 || (item && int(Item::Type) == item->type()) ? static_cast<T>(item) : nullptr;
974}
975
976template <class T> inline T qgraphicsitem_cast(const QGraphicsItem *item)
977{
978 typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type Item;
979 return int(Item::Type) == int(QGraphicsItem::Type)
980 || (item && int(Item::Type) == item->type()) ? static_cast<T>(item) : nullptr;
981}
982
983#ifndef QT_NO_DEBUG_STREAM
984Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, const QGraphicsItem *item);
985Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, const QGraphicsObject *item);
988Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlags flags);
989#endif
990
992
993QT_DECL_METATYPE_EXTERN_TAGGED(QGraphicsItem*, QGraphicsItem_ptr, Q_WIDGETS_EXPORT)
994
995#endif // QGRAPHICSITEM_H
bool isActive
Definition lalr.h:84
The QAbstractGraphicsShapeItem class provides a common base for all path items.
\inmodule QtGui
Definition qbrush.h:30
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
The QCursor class provides a mouse cursor with an arbitrary shape.
Definition qcursor.h:45
\inmodule QtCore
\inmodule QtCore
Definition qcoreevent.h:45
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:470
\reentrant
Definition qfont.h:22
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)
Sets the item's ellipse geometry to 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.
void setTransformOriginPoint(qreal ax, qreal ay)
QRectF mapRectToItem(const QGraphicsItem *item, const QRectF &rect) const
GraphicsItemChange
This enum describes the state changes that are notified by QGraphicsItem::itemChange().
@ ItemTransformOriginPointChange
QPointF mapToItem(const QGraphicsItem *item, const QPointF &point) const
Maps the point point, which is in this item's coordinate system, to item's coordinate system,...
QScopedPointer< QGraphicsItemPrivate > d_ptr
void ensureVisible(const QRectF &rect=QRectF(), int xmargin=50, int ymargin=50)
If this item is part of a scene that is viewed by a QGraphicsView, this convenience function will att...
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
bool isObscured(const QRectF &rect=QRectF()) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr)=0
This function, which is usually called by QGraphicsView, paints the contents of an item in local coor...
void moveBy(qreal dx, qreal dy)
Moves the item by dx points horizontally, and dy point vertically.
void show()
Shows the item (items are visible by default).
qreal y() const
This convenience function is equivalent to calling pos().y().
GraphicsItemFlag
This enum describes different flags that you can set on an item to toggle different features in the i...
virtual QRectF boundingRect() const =0
This pure virtual function defines the outer bounds of the item as a rectangle; all painting must be ...
QPointF mapFromItem(const QGraphicsItem *item, const QPointF &point) const
Maps the point point, which is in item's coordinate system, to this item's coordinate system,...
void setPos(const QPointF &pos)
Sets the position of the item to pos, which is in parent coordinates.
QRectF mapRectToParent(const QRectF &rect) const
qreal x() const
This convenience function is equivalent to calling pos().x().
QPointF mapToScene(const QPointF &point) const
Maps the point point, which is in this item's coordinate system, to the scene's coordinate system,...
QRectF mapRectToScene(const QRectF &rect) const
virtual int type() const
Returns the type of an item as an int.
QPointF mapToParent(const QPointF &point) const
Maps the point point, which is in this item's coordinate system, to its parent's coordinate system,...
QRectF mapRectFromItem(const QGraphicsItem *item, const QRectF &rect) const
QRectF mapRectFromScene(const QRectF &rect) const
QPointF mapFromParent(const QPointF &point) const
Maps the point point, which is in this item's parent's coordinate system, to this item's coordinate s...
QRectF mapRectFromParent(const QRectF &rect) const
void hide()
Hides the item (items are visible by default).
QPointF mapFromScene(const QPointF &point) const
Maps the point point, which is in this item's scene's coordinate system, to this item's coordinate sy...
The QGraphicsLineItem class provides a line item that you can add to a QGraphicsScene.
void setLine(qreal x1, qreal y1, qreal x2, qreal y2)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QGraphicsObject class provides a base class for all graphics items that require signals,...
void heightChanged()
void zChanged()
This signal gets emitted whenever the z value of the item changes.
void xChanged()
This signal gets emitted whenever the x position of the item changes.
void visibleChanged()
This signal gets emitted whenever the visibility of the item changes.
void childrenChanged()
This signal gets emitted whenever the children list changes.
void rotationChanged()
This signal gets emitted whenever the rotation of the item changes.
void parentChanged()
This signal gets emitted whenever the parent of the item changes.
void opacityChanged()
This signal gets emitted whenever the opacity of the item changes.
void yChanged()
This signal gets emitted whenever the y position of the item changes.
void scaleChanged()
This signal is emitted when the scale of the item changes.
void enabledChanged()
This signal gets emitted whenever the item gets enabled or disabled.
int type() const override
Returns the type of an item as an int.
The QGraphicsPixmapItem class provides a pixmap item that you can add to a QGraphicsScene.
ShapeMode
This enum describes how QGraphicsPixmapItem calculates its shape and opaque area.
void setOffset(const QPointF &offset)
Sets the pixmap item's offset to 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)
Sets the item's rectangle to be the given rectangle.
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 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 QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
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 &)
This signal is emitted when the user hovers over a link on a text item that enables Qt::LinksAccessib...
void linkActivated(const QString &)
This signal is emitted when the user clicks on a link on a text item that enables Qt::LinksAccessible...
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.
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.
The QInputMethodEvent class provides parameters for input method events.
Definition qevent.h:625
The QKeyEvent class describes a key event.
Definition qevent.h:424
\inmodule QtCore\compares equality \compareswith equality QLine \endcompareswith
Definition qline.h:192
The QMenu class provides a menu widget for use in menu bars, context menus, and other popup menus.
Definition qmenu.h:26
\inmodule QtCore
Definition qobject.h:103
const QObjectList & children() const
Returns a list of child objects.
Definition qobject.h:201
\inmodule QtGui
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
\inmodule QtGui
Definition qpen.h:28
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
\inmodule QtCore\reentrant
Definition qpoint.h:217
The QPolygonF class provides a list of points using floating point precision.
Definition qpolygon.h:96
\inmodule QtCore\reentrant
Definition qrect.h:484
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
\reentrant \inmodule QtGui
Definition qtextcursor.h:30
\reentrant \inmodule QtGui
The QTransform class specifies 2D transformations of a coordinate system.
Definition qtransform.h:20
\inmodule QtCore
Definition qvariant.h:65
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
void extension()
[6]
Definition dialogs.cpp:230
QOpenGLWidget * widget
[1]
QPainter paint
QString text
QCursor cursor
rect
[4]
Combined button and popup list for selecting options.
InputMethodQuery
TransformationMode
ItemSelectionMode
@ IntersectsItemShape
GestureType
FocusReason
@ OtherFocusReason
Definition brush.cpp:5
static QString toPlainText(const QString &text)
DBusConnection const char * rule
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
T qgraphicsitem_cast(QGraphicsItem *item)
Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, const QGraphicsItem *item)
bool qt_closestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2)
bool qt_closestItemFirst(const QGraphicsItem *item1, const QGraphicsItem *item2)
Returns true if item1 is on top of item2.
static void unsetCursor(QWindow *w)
#define QT_DECL_METATYPE_EXTERN_TAGGED(TYPE, TAG, EXPORT)
Definition qmetatype.h:1376
#define Q_DECLARE_INTERFACE(IFace, IId)
Definition qobject.h:460
static bool contains(const QJsonArray &haystack, unsigned needle)
Definition qopengl.cpp:116
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
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLsizei width
GLenum type
GLboolean GLuint group
GLfloat angle
GLbitfield flags
GLenum GLuint GLintptr offset
GLint y
GLfloat GLfloat GLfloat GLfloat h
struct _cl_event * event
GLuint GLenum GLenum transform
GLenum query
const GLubyte * c
GLfixed GLfixed GLfixed y2
GLuint GLenum matrix
GLfixed GLfixed x2
GLsizei const GLchar *const * path
GLuint GLenum option
GLenum GLenum GLenum GLenum GLenum scale
static quint64 cacheSize()
static const QRectF boundingRect(const QPointF *points, int pointCount)
decorationRoleName setToolTip
static bool isWindow(QObject *object)
#define QT_REQUIRE_CONFIG(feature)
static void setPen(QPainter *p, const QPen &defaultPen, const QTextCharFormat &chf)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INTERFACES(x)
#define Q_SLOTS
#define QDOC_PROPERTY(text)
#define Q_SIGNALS
#define Q_PRIVATE_PROPERTY(d, text)
double qreal
Definition qtypes.h:187
QWidget * panel
Definition settings.cpp:7
file open(QIODevice::ReadOnly)
mimeData setData("text/csv", csvData)
QVariant variant
[1]
p setX(p.x()+1)
QSharedPointer< T > other(t)
[5]
QGraphicsOpacityEffect * effect
the effect attached to this item
QGraphicsScene scene
[0]
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]
aWidget window() -> setWindowTitle("New Window Title")
[2]
insertRed setText("insert red text")
edit textCursor().insertText(text)
[0]
imageLabel setPixmap(QPixmap::fromImage(image))
Definition moc.h:23