40 #ifndef QGRAPHICSITEM_P_H
41 #define QGRAPHICSITEM_P_H
54 #include <QtWidgets/private/qtwidgetsglobal_p.h>
58 #include <private/qgraphicsview_p.h>
60 #include <private/qgraphicstransform_p.h>
62 #include <QtCore/qpoint.h>
70 #ifndef QDECLARATIVELISTPROPERTY
71 #define QDECLARATIVELISTPROPERTY
90 return object ==
o.object &&
163 ExtraBoundingRegionGranularity
168 AncestorHandlesChildEvents = 0x1,
169 AncestorClipsChildren = 0x2,
170 AncestorIgnoresTransformations = 0x4,
171 AncestorFiltersChildEvents = 0x8,
172 AncestorContainsChildren = 0x10
187 void updateChildWithGraphicsEffectFlagRecursively();
189 AncestorFlag flag = NoFlag,
bool enabled =
false,
bool root =
true);
190 void updateAncestorFlags();
191 void setIsMemberOfGroup(
bool enabled);
198 || (ancestorFlags & AncestorIgnoresTransformations);
203 virtual void updateSceneTransformFromParent();
207 virtual void setPosHelper(
const QPointF &
pos);
211 void setVisibleHelper(
bool newVisible,
bool explicitly,
bool update =
true,
212 bool hiddenByPanel =
false);
213 void setEnabledHelper(
bool newEnabled,
bool explicitly,
bool update =
true);
214 bool discardUpdateRequest(
bool ignoreVisibleBit =
false,
215 bool ignoreDirtyBit =
false,
bool ignoreOpacity =
false)
const;
218 #if QT_CONFIG(graphicseffect)
219 enum InvalidateReason {
222 void invalidateParentGraphicsEffectsRecursively();
223 void invalidateChildGraphicsEffectsRecursively(InvalidateReason reason);
225 void invalidateDepthRecursively();
231 const QVariant *thisPointerVariant);
234 const QRegion &exposedRegion,
bool allItems =
false)
const;
236 QRectF sceneEffectiveBoundingRect()
const;
242 for (
int i = 0;
i < children.size(); ++
i)
243 children.at(
i)->d_ptr->resolveFont(inheritedMask);
248 for (
int i = 0;
i < children.size(); ++
i)
249 children.at(
i)->d_ptr->resolvePalette(inheritedMask);
252 virtual bool isProxyWidget()
const;
256 for (
int i = 0;
i < extras.size(); ++
i) {
267 for (
int i = 0;
i < extras.size(); ++
i) {
268 if (extras.at(
i).type ==
type) {
283 for (
int i = 0;
i < extras.size(); ++
i) {
284 if (extras.at(
i).type ==
type) {
301 {
return type < extra; }
308 void removeExtraItemCache();
310 void updatePaintedViewBoundingRects(
bool updateChildren);
311 void ensureSceneTransformRecursive(
QGraphicsItem **topMostDirtyItem);
315 ensureSceneTransformRecursive(&that);
320 ensureSceneTransform();
321 return sceneTransformTranslateOnly;
326 for (
int i = 0;
i < children.size(); ++
i)
327 children.at(
i)->d_ptr->dirtySceneTransform = 1;
336 int parentFlags =
p->d_ptr->flags;
346 o *=
p->d_ptr->opacity;
347 p =
p->d_ptr->parent;
348 myFlags = parentFlags;
354 {
return (opacity <
qreal(0.001)); }
357 {
return (opacity <
qreal(0.001)); }
366 return isOpacityNull(calcEffectiveOpacity());
373 return calcEffectiveOpacity();
380 return parentOpacity * opacity;
387 if (!children.size())
392 for (
int i = 0;
i < children.size(); ++
i) {
404 return !visible || (childrenCombineOpacity() && isFullyTransparent());
407 inline void markParentDirty(
bool updateBoundingRect =
false);
409 void setFocusHelper(
Qt::FocusReason focusReason,
bool climb,
bool focusFromHide);
410 void clearFocusHelper(
bool giveFocusToParent,
bool hiddenByParentPanel);
413 void resetFocusProxy();
414 virtual void subFocusItemChange();
415 virtual void focusScopeItemChange(
bool isSubFocusItem);
423 inline void ensureSortedChildren();
425 void ensureSequentialSiblingIndex();
426 inline void sendScenePosChange();
427 virtual void siblingOrderChange();
431 virtual void setWidth(
qreal);
432 virtual void resetWidth();
435 virtual void setHeight(
qreal);
436 virtual void resetHeight();
460 #ifndef QT_NO_GESTURES
547 if (!postmultiplyTransform || postmultiplyTransform->isIdentity())
550 return *postmultiplyTransform;
551 return transform * *postmultiplyTransform;
559 x *=
m.toTransform();
565 if (postmultiplyTransform)
566 x *= *postmultiplyTransform;
593 #if QT_CONFIG(graphicseffect)
631 {
return info ?
info->option :
nullptr; }
636 qWarning(
"QGraphicsEffectSource::deviceRect: Not yet implemented, lacking device context");
639 return info->widget->rect();
666 if (
d1->parent ==
d2->parent)
671 int item1Depth =
d1->depth();
672 int item2Depth =
d2->depth();
675 while (item1Depth > item2Depth && (
p =
p->d_ptr->parent)) {
685 while (item2Depth > item1Depth && (
p =
p->d_ptr->parent)) {
700 t1 =
t1->d_ptr->parent;
701 t2 =
t2->d_ptr->parent;
733 return d1->z >
d2->z;
734 return d1->siblingIndex >
d2->siblingIndex;
778 return a->d_ptr->siblingIndex <
b->d_ptr->siblingIndex;
787 #if QT_CONFIG(graphicseffect)
790 static_cast<QGraphicsItemEffectSourcePrivate *
>(parentp->
graphicsEffect->d_func()
798 if (updateBoundingRect) {
803 #if QT_CONFIG(graphicseffect)
805 if (updateBoundingRect) {
806 static_cast<QGraphicsItemEffectSourcePrivate *
>(parentp->
graphicsEffect->d_func()
small capitals from c petite p scientific i
[1]
T *(* AtFunction)(QDeclarativeListProperty< T > *, int)
int(* CountFunction)(QDeclarativeListProperty< T > *)
QDeclarativeListProperty()
void(* ClearFunction)(QDeclarativeListProperty< T > *)
QDeclarativeListProperty(QObject *o, void *d, AppendFunction a, CountFunction c=nullptr, AtFunction t=nullptr, ClearFunction r=nullptr)
void(* AppendFunction)(QDeclarativeListProperty< T > *, T *)
bool operator==(const QDeclarativeListProperty &o) const
QDeclarativeListProperty(QObject *o, QList< T * > &list)
The QEvent class is the base class of all event classes. Event objects contain event parameters.
The QGraphicsEffect class is the base class for all graphics effects.
QGraphicsEffectSource * source() const
virtual const QStyleOption * styleOption() const =0
virtual bool isPixmap() const =0
QGraphicsEffectSourcePrivate()
virtual QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset=nullptr, QGraphicsEffect::PixmapPadMode mode=QGraphicsEffect::PadToTransparentBorder) const =0
virtual const QGraphicsItem * graphicsItem() const =0
virtual QRectF boundingRect(Qt::CoordinateSystem system) const =0
virtual const QWidget * widget() const =0
virtual void draw(QPainter *p)=0
virtual QRect deviceRect() const =0
virtual void effectBoundingRectChanged()=0
QHash< QPaintDevice *, DeviceData > deviceData
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
QScopedPointer< QGraphicsItemPrivate > d_ptr
void update(const QRectF &rect=QRectF())
@ ItemDoesntPropagateOpacityToChildren
@ ItemIgnoresTransformations
@ ItemClipsChildrenToShape
@ ItemIgnoresParentOpacity
void prepareGeometryChange()
GraphicsItemFlags flags() const
quint32 localCollisionHack
bool isOpacityNull() const
QGraphicsItem * subFocusItem
void invalidateChildrenSceneTransform()
QVariant extra(Extra type) const
quint32 dirtySceneTransform
static bool insertionOrder(QGraphicsItem *a, QGraphicsItem *b)
quint32 isDeclarativeItem
Qt::InputMethodHints imHints
QList< QGraphicsItem ** > focusProxyRefs
QTransform transformToParent() const
QGraphicsEffect * graphicsEffect
@ ExtraMaxDeviceCoordCacheSize
QGraphicsItem * focusProxy
void markParentDirty(bool updateBoundingRect=false)
QGraphicsItem * focusScopeItem
quint32 explicitlyDisabled
void combineTransformToParent(QTransform *x, const QTransform *viewTransform=nullptr) const
quint32 notifyInvalidated
QMap< Qt::GestureType, Qt::GestureFlags > gestureContext
bool itemIsUntransformable() const
quint32 filtersDescendantEvents
QList< ExtraStruct > extras
quint32 mayHaveChildWithGraphicsEffect
quint32 acceptedMouseButtons
quint32 dirtyChildrenBoundingRect
void setExtra(Extra type, const QVariant &value)
QGraphicsItem::PanelModality panelModality
virtual void transformChanged()
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
bool childrenCombineOpacity() const
void ensureSceneTransform()
QList< QGraphicsItem * > children
quint32 updateDueToGraphicsEffect
quint32 hasBoundingRegionGranularity
quint32 acceptedTouchBeginEvent
quint32 sceneTransformTranslateOnly
quint32 sendParentChangeNotification
quint32 scenePosDescendants
bool isFullyTransparent() const
quint32 acceptTouchEvents
bool childrenClippedToShape() const
quint32 sequentialOrdering
quint32 paintedViewBoundingRectsNeedRepaint
bool hasTranslateOnlySceneTransform()
QRectF childrenBoundingRect
quint32 holesInSiblingIndex
virtual void resolvePalette(uint inheritedMask)
qreal effectiveOpacity() const
quint32 handlesChildEvents
quint32 notifyBoundingRectChanged
TransformData * transformData
QTransform sceneTransform
QHash< QWidget *, QRect > paintedViewBoundingRects
virtual void resolveFont(uint inheritedMask)
qreal combineOpacityFromParent(qreal parentOpacity) const
void unsetExtra(Extra type)
qreal calcEffectiveOpacity() const
void ensureSortedChildren()
static QGraphicsItemPrivate * get(QGraphicsItem *item)
static bool isOpacityNull(qreal opacity)
quint32 fullUpdatePending
The QGraphicsObject class provides a base class for all graphics items that require signals,...
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
The QHash class is a template class that provides a hash-table-based dictionary.
qsizetype size() const noexcept
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
The QObject class is the base class of all Qt objects.
The QPainter class performs low-level painting on widgets and other paint devices.
The QPixmapCache::Key class can be used for efficient access to the QPixmapCache. \inmodule QtGui.
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 QPoint class defines a point in the plane using integer precision.
The QRectF class defines a finite rectangle in the plane using floating point precision.
The QRect class defines a rectangle in the plane using integer precision.
The QRegion class specifies a clip region for a painter.
T * data() const noexcept
The QSize class defines the size of a two-dimensional object using integer point precision.
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
The QStyleOption class stores the parameters used by QStyle functions.
The QVariant class acts like a union for the most common Qt data types.
backing_store_ptr info
[4]
EGLOutputLayerEXT EGLint EGLAttrib value
QT_END_INCLUDE_NAMESPACE typedef double qreal
bool qt_closestItemLast(const QGraphicsItem *item1, const QGraphicsItem *item2)
Q_DECLARE_TYPEINFO(QGraphicsItemPrivate::ExtraStruct, Q_RELOCATABLE_TYPE)
QT_REQUIRE_CONFIG(graphicsview)
bool qt_closestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2)
bool qt_notclosestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2)
bool qt_closestItemFirst(const QGraphicsItem *item1, const QGraphicsItem *item2)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLint GLenum GLsizei GLsizei GLsizei depth
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLenum GLsizei count
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
[4]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLuint GLenum GLenum transform
GLenum GLenum GLenum GLenum GLenum scale
view viewport() -> scroll(dx, dy, deviceRect)
const QTransform * transformPtr
const QTransform * effectTransform
quint32 wasDirtySceneTransform
QGraphicsItemPaintInfo(const QTransform *const xform1, const QTransform *const xform2, const QTransform *const xform3, QRegion *r, QWidget *w, QStyleOptionGraphicsItem *opt, QPainter *p, qreal o, bool b1, bool b2)
QStyleOptionGraphicsItem * option
const QTransform * viewTransform
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent