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>
15class tst_QGraphicsItem;
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,
65 ItemIsFocusScope = 0x8000,
66 ItemSendsScenePositionChanges = 0x10000,
67 ItemStopsClickFocusPropagation = 0x20000,
68 ItemStopsFocusHandling = 0x40000,
69 ItemContainsChildrenInShape = 0x80000
76 ItemVisibleChange = 2,
107 ItemTransformOriginPointHasChanged
113 DeviceCoordinateCache
137 bool isWidget()
const;
139 bool isPanel()
const;
147 GraphicsItemFlags
flags()
const;
148 void setFlag(GraphicsItemFlag flag,
bool enabled =
true);
149 void setFlags(GraphicsItemFlags
flags);
151 CacheMode cacheMode()
const;
154 PanelModality panelModality()
const;
155 void setPanelModality(PanelModality panelModality);
156 bool isBlockedByModalPanel(
QGraphicsItem **blockingPanel =
nullptr)
const;
158#if QT_CONFIG(tooltip)
166 bool hasCursor()
const;
172 void setVisible(
bool visible);
173 inline void hide() { setVisible(
false); }
174 inline void show() { setVisible(
true); }
176 bool isEnabled()
const;
179 bool isSelected()
const;
180 void setSelected(
bool selected);
182 bool acceptDrops()
const;
183 void setAcceptDrops(
bool on);
185 qreal opacity()
const;
186 qreal effectiveOpacity()
const;
187 void setOpacity(
qreal opacity);
189#if QT_CONFIG(graphicseffect)
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);
202 bool filtersChildEvents()
const;
203 void setFiltersChildEvents(
bool enabled);
205 bool handlesChildEvents()
const;
206 void setHandlesChildEvents(
bool enabled);
209 void setActive(
bool active);
211 bool hasFocus()
const;
224 void ungrabKeyboard();
237 void ensureVisible(
const QRectF &
rect =
QRectF(),
int xmargin = 50,
int ymargin = 50);
246 void resetTransform();
248 qreal rotation()
const;
256 QPointF transformOriginPoint()
const;
257 void setTransformOriginPoint(
const QPointF &origin);
259 { setTransformOriginPoint(
QPointF(ax,ay)); }
261 virtual void advance(
int phase);
264 qreal zValue()
const;
270 QRectF childrenBoundingRect()
const;
271 QRectF sceneBoundingRect()
const;
273 bool isClipped()
const;
285 qreal boundingRegionGranularity()
const;
286 void setBoundingRegionGranularity(
qreal granularity);
347 bool isUnderMouse()
const;
353 Qt::InputMethodHints inputMethodHints()
const;
354 void setInputMethodHints(Qt::InputMethodHints hints);
360 virtual int type()
const;
366 void updateMicroFocus();
392 UserExtension = 0x80000000
394 virtual bool supportsExtension(Extension
extension)
const;
403 void removeFromIndex();
404 void prepareGeometryChange();
412 friend class QGraphicsSceneFindItemBspTreeVisitor;
424 friend class QGraphicsItemEffectSourcePrivate;
426#ifndef QT_NO_GESTURES
429 friend class ::tst_QGraphicsItem;
490 Q_PROPERTY(
qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged FINAL)
497 Q_PROPERTY(
qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged)
499 Q_PROPERTY(
QPointF transformOriginPoint READ transformOriginPoint WRITE setTransformOriginPoint)
500#if QT_CONFIG(graphicseffect)
504 NOTIFY widthChanged RESET resetWidth FINAL)
506 NOTIFY heightChanged RESET resetHeight FINAL)
514#ifndef QT_NO_GESTURES
520 void updateMicroFocus();
555 void setPen(
const QPen &pen);
628 int type()
const override;
631 bool supportsExtension(Extension
extension)
const override;
656 int startAngle()
const;
657 void setStartAngle(
int angle);
659 int spanAngle()
const;
660 void setSpanAngle(
int angle);
672 int type()
const override;
675 bool supportsExtension(Extension
extension)
const override;
712 int type()
const override;
715 bool supportsExtension(Extension
extension)
const override;
734 void setPen(
const QPen &pen);
751 int type()
const override;
754 bool supportsExtension(Extension
extension)
const override;
797 int type()
const override;
799 ShapeMode shapeMode()
const;
800 void setShapeMode(ShapeMode
mode);
803 bool supportsExtension(Extension
extension)
const override;
821 QDOC_PROPERTY(
bool openExternalLinks READ openExternalLinks WRITE setOpenExternalLinks)
830 void setHtml(
const QString &html);
838 void setDefaultTextColor(
const QColor &
c);
839 QColor defaultTextColor()
const;
851 int type()
const override;
854 qreal textWidth()
const;
861 void setTextInteractionFlags(Qt::TextInteractionFlags
flags);
862 Qt::TextInteractionFlags textInteractionFlags()
const;
864 void setTabChangesFocus(
bool b);
865 bool tabChangesFocus()
const;
867 void setOpenExternalLinks(
bool open);
868 bool openExternalLinks()
const;
933 int type()
const override;
936 bool supportsExtension(Extension
extension)
const override;
962 int type()
const override;
971 typedef typename std::remove_cv<typename std::remove_pointer<T>::type>
::type Item;
973 || (
item && int(Item::Type) ==
item->
type()) ?
static_cast<T
>(
item) :
nullptr;
978 typedef typename std::remove_cv<typename std::remove_pointer<T>::type>
::type Item;
980 || (
item && int(Item::Type) ==
item->
type()) ?
static_cast<T
>(
item) :
nullptr;
983#ifndef QT_NO_DEBUG_STREAM
The QAbstractGraphicsShapeItem class provides a common base for all path items.
The QColor class provides colors based on RGB, HSV or CMYK values.
The QCursor class provides a mouse cursor with an arbitrary shape.
The QFocusEvent class contains event parameters for widget focus events.
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
@ ItemTransformHasChanged
@ ItemScenePositionHasChanged
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 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 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 QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
The QKeyEvent class describes a key event.
const QObjectList & children() const
Returns a list of child objects.
The QPainter class performs low-level painting on widgets and other paint devices.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\inmodule QtCore\reentrant
The QPolygonF class provides a list of points using floating point precision.
\inmodule QtCore\reentrant
The QRegion class specifies a clip region for a painter.
\macro QT_RESTRICTED_CAST_FROM_ASCII
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
\reentrant \inmodule QtGui
\reentrant \inmodule QtGui
Combined button and popup list for selecting options.
static QString toPlainText(const QString &text)
DBusConnection const char * rule
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
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 Q_DECLARE_INTERFACE(IFace, IId)
static bool contains(const QJsonArray &haystack, unsigned needle)
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
static quint64 cacheSize()
static const QRectF boundingRect(const QPointF *points, int pointCount)
decorationRoleName setToolTip
static bool isWindow(QObject *object)
#define QT_REQUIRE_CONFIG(feature)
file open(QIODevice::ReadOnly)
mimeData setData("text/csv", csvData)
QGraphicsOpacityEffect * effect
the effect attached to this item
line installSceneEventFilter(ellipse)
rect sceneTransform().map(QPointF(0
item setCursor(Qt::IBeamCursor)
[1]
rect deviceTransform(view->viewportTransform()).map(QPointF(0
view setCacheMode(QGraphicsView::CacheBackground)
insertRed setText("insert red text")
edit textCursor().insertText(text)
[0]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent