40 #ifndef QGRAPHICSITEM_H
41 #define QGRAPHICSITEM_H
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>
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,
102 ItemSendsScenePositionChanges = 0x10000,
103 ItemStopsClickFocusPropagation = 0x20000,
104 ItemStopsFocusHandling = 0x40000,
105 ItemContainsChildrenInShape = 0x80000
112 ItemVisibleChange = 2,
143 ItemTransformOriginPointHasChanged
149 DeviceCoordinateCache
173 bool isWidget()
const;
174 bool isWindow()
const;
175 bool isPanel()
const;
183 GraphicsItemFlags
flags()
const;
184 void setFlag(GraphicsItemFlag flag,
bool enabled =
true);
185 void setFlags(GraphicsItemFlags
flags);
187 CacheMode cacheMode()
const;
190 PanelModality panelModality()
const;
191 void setPanelModality(PanelModality panelModality);
192 bool isBlockedByModalPanel(
QGraphicsItem **blockingPanel =
nullptr)
const;
194 #if QT_CONFIG(tooltip)
202 bool hasCursor()
const;
208 void setVisible(
bool visible);
209 inline void hide() { setVisible(
false); }
210 inline void show() { setVisible(
true); }
212 bool isEnabled()
const;
215 bool isSelected()
const;
216 void setSelected(
bool selected);
218 bool acceptDrops()
const;
219 void setAcceptDrops(
bool on);
221 qreal opacity()
const;
222 qreal effectiveOpacity()
const;
223 void setOpacity(
qreal opacity);
225 #if QT_CONFIG(graphicseffect)
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);
238 bool filtersChildEvents()
const;
239 void setFiltersChildEvents(
bool enabled);
241 bool handlesChildEvents()
const;
242 void setHandlesChildEvents(
bool enabled);
245 void setActive(
bool active);
247 bool hasFocus()
const;
260 void ungrabKeyboard();
273 void ensureVisible(
const QRectF &
rect =
QRectF(),
int xmargin = 50,
int ymargin = 50);
282 void resetTransform();
292 QPointF transformOriginPoint()
const;
293 void setTransformOriginPoint(
const QPointF &origin);
295 { setTransformOriginPoint(
QPointF(ax,ay)); }
297 virtual void advance(
int phase);
300 qreal zValue()
const;
306 QRectF childrenBoundingRect()
const;
307 QRectF sceneBoundingRect()
const;
309 bool isClipped()
const;
321 qreal boundingRegionGranularity()
const;
322 void setBoundingRegionGranularity(
qreal granularity);
383 bool isUnderMouse()
const;
389 Qt::InputMethodHints inputMethodHints()
const;
390 void setInputMethodHints(Qt::InputMethodHints hints);
396 virtual int type()
const;
402 void updateMicroFocus();
428 UserExtension = 0x80000000
430 virtual bool supportsExtension(Extension extension)
const;
431 virtual void setExtension(Extension extension,
const QVariant &
variant);
439 void removeFromIndex();
440 void prepareGeometryChange();
460 friend class QGraphicsItemEffectSourcePrivate;
462 #ifndef QT_NO_GESTURES
465 friend class ::tst_QGraphicsItem;
526 Q_PROPERTY(
qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged FINAL)
535 Q_PROPERTY(
QPointF transformOriginPoint READ transformOriginPoint WRITE setTransformOriginPoint)
536 #if QT_CONFIG(graphicseffect)
540 READ childrenList DESIGNABLE
false NOTIFY childrenChanged)
542 NOTIFY widthChanged RESET resetWidth FINAL)
544 NOTIFY heightChanged RESET resetHeight FINAL)
553 #ifndef QT_NO_GESTURES
559 void updateMicroFocus();
594 void setPen(
const QPen &pen);
622 QRectF boundingRect()
const override;
635 bool supportsExtension(
Extension extension)
const override;
657 QRectF boundingRect()
const override;
667 int type()
const override;
670 bool supportsExtension(Extension extension)
const override;
671 void setExtension(Extension extension,
const QVariant &
variant)
override;
695 int startAngle()
const;
696 void setStartAngle(
int angle);
698 int spanAngle()
const;
699 void setSpanAngle(
int angle);
701 QRectF boundingRect()
const override;
711 int type()
const override;
714 bool supportsExtension(Extension extension)
const override;
715 void setExtension(Extension extension,
const QVariant &
variant)
override;
741 QRectF boundingRect()
const override;
751 int type()
const override;
754 bool supportsExtension(Extension extension)
const override;
755 void setExtension(Extension extension,
const QVariant &
variant)
override;
773 void setPen(
const QPen &pen);
780 QRectF boundingRect()
const override;
790 int type()
const override;
793 bool supportsExtension(Extension extension)
const override;
794 void setExtension(Extension extension,
const QVariant &
variant)
override;
826 QRectF boundingRect()
const override;
836 int type()
const override;
838 ShapeMode shapeMode()
const;
839 void setShapeMode(ShapeMode
mode);
842 bool supportsExtension(Extension extension)
const override;
843 void setExtension(Extension extension,
const QVariant &
variant)
override;
860 QDOC_PROPERTY(
bool openExternalLinks READ openExternalLinks WRITE setOpenExternalLinks)
877 void setDefaultTextColor(
const QColor &
c);
878 QColor defaultTextColor()
const;
880 QRectF boundingRect()
const override;
890 int type()
const override;
893 qreal textWidth()
const;
900 void setTextInteractionFlags(Qt::TextInteractionFlags
flags);
901 Qt::TextInteractionFlags textInteractionFlags()
const;
903 void setTabChangesFocus(
bool b);
904 bool tabChangesFocus()
const;
906 void setOpenExternalLinks(
bool open);
907 bool openExternalLinks()
const;
938 bool supportsExtension(
Extension extension)
const override;
962 QRectF boundingRect()
const override;
972 int type()
const override;
975 bool supportsExtension(Extension extension)
const override;
976 void setExtension(Extension extension,
const QVariant &
variant)
override;
994 QRectF boundingRect()
const override;
1001 int type()
const override;
1022 #ifndef QT_NO_DEBUG_STREAM
The QAbstractGraphicsShapeItem class provides a common base for all path items.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
The QColor class provides colors based on RGB, HSV or CMYK values.
The QCursor class provides a mouse cursor with an arbitrary shape.
operator<<(QDataStream &ds, qfloat16 f)
The QDebug class provides an output stream for debugging information.
The QEvent class is the base class of all event classes. Event objects contain event parameters.
The QFocusEvent class contains event parameters for widget focus events. \inmodule QtGui.
The QFont class specifies a query for a font used for drawing text.
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.
void setTransformOriginPoint(qreal ax, qreal ay)
QRectF mapRectToItem(const QGraphicsItem *item, const QRectF &rect) const
@ ItemTransformOriginPointChange
@ ItemTransformHasChanged
@ 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)
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
QPointF mapToScene(const QPointF &point) const
QRectF mapRectToScene(const QRectF &rect) 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,...
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 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 QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
The QKeyEvent class describes a key event.
The QLineF class provides a two-dimensional vector using floating point precision.
The QObject class is the base class of all Qt objects.
const QObjectList & children() const
The QPainter class performs low-level painting on widgets and other paint devices.
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
The QPen class defines how a QPainter should draw lines and outlines of shapes.
The QPixmap class is an off-screen image representation that can be used as a paint device.
The QPointF class defines a point in the plane using floating point precision.
The QPolygonF class provides a list of points using floating point precision. \inmodule QtGui.
The QRectF class defines a finite rectangle in the plane using floating point precision.
The QRegion class specifies a clip region for a painter.
The QSize class defines the size of a two-dimensional object using integer point precision.
The QString class provides a Unicode character string.
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
The QTextCursor class offers an API to access and modify QTextDocuments.
The QTextDocument class holds formatted text.
The QVariant class acts like a union for the most common Qt data types.
DBusConnection const char * rule
EGLOutputLayerEXT EGLint EGLAttrib value
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
QT_END_INCLUDE_NAMESPACE typedef double qreal
#define Q_DISABLE_COPY(Class)
QT_REQUIRE_CONFIG(graphicsview)
bool qt_closestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2)
bool qt_closestItemFirst(const QGraphicsItem *item1, const QGraphicsItem *item2)
#define Q_DECLARE_INTERFACE(IFace, IId)
GLboolean GLboolean GLboolean b
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
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 GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLfloat GLfloat GLfloat GLfloat h
GLuint GLenum GLenum transform
GLfixed GLfixed GLfixed y2
GLsizei const GLchar *const * path
GLenum GLenum GLenum GLenum GLenum scale
file open(QIODevice::ReadOnly)
mimeData setData("text/csv", csvData)
QGraphicsOpacityEffect * effect
item setTransform(QTransform().translate(x, y).rotate(45).translate(-x, -y))
line installSceneEventFilter(ellipse)
rect sceneTransform().map(QPointF(0
item setCursor(Qt::IBeamCursor)
[1]
rect deviceTransform(view->viewportTransform()).map(QPointF(0
view setCacheMode(QGraphicsView::CacheBackground)
edit textCursor().insertText(text)
[0]
backaction setToolTip(browser.historyTitle(-1))
[0]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent