Qt 4.8
qgraphicsitem_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui 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 Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QGRAPHICSITEM_P_H
43 #define QGRAPHICSITEM_P_H
44 
45 //
46 // W A R N I N G
47 // -------------
48 //
49 // This file is not part of the Qt API. It exists for the convenience
50 // of other Qt classes. This header file may change from version to
51 // version without notice, or even be removed.
52 //
53 // We mean it.
54 //
55 
56 #include "qgraphicsitem.h"
57 #include "qset.h"
58 #include "qpixmapcache.h"
59 #include <private/qgraphicsview_p.h>
60 #include "qgraphicstransform.h"
61 #include <private/qgraphicstransform_p.h>
62 
63 #include <private/qgraphicseffect_p.h>
64 #include <qgraphicseffect.h>
65 
66 #include <QtCore/qpoint.h>
67 
68 #if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW
69 
71 
73 
74 #ifndef QDECLARATIVELISTPROPERTY
75 #define QDECLARATIVELISTPROPERTY
76 template<typename T>
78 public:
80  typedef int (*CountFunction)(QDeclarativeListProperty<T> *);
81  typedef T *(*AtFunction)(QDeclarativeListProperty<T> *, int);
82  typedef void (*ClearFunction)(QDeclarativeListProperty<T> *);
83 
85  : object(0), data(0), append(0), count(0), at(0), clear(0), dummy1(0), dummy2(0) {}
88  clear(qlist_clear), dummy1(0), dummy2(0) {}
90  ClearFunction r = 0)
91  : object(o), data(d), append(a), count(c), at(t), clear(r), dummy1(0), dummy2(0) {}
92 
93  bool operator==(const QDeclarativeListProperty &o) const {
94  return object == o.object &&
95  data == o.data &&
96  append == o.append &&
97  count == o.count &&
98  at == o.at &&
99  clear == o.clear;
100  }
101 
102  QObject *object;
103  void *data;
104 
106 
108  AtFunction at;
109 
111 
112  void *dummy1;
113  void *dummy2;
114 
115 private:
116  static void qlist_append(QDeclarativeListProperty *p, T *v) {
117  ((QList<T *> *)p->data)->append(v);
118  }
120  return ((QList<T *> *)p->data)->count();
121  }
122  static T *qlist_at(QDeclarativeListProperty *p, int idx) {
123  return ((QList<T *> *)p->data)->at(idx);
124  }
126  return ((QList<T *> *)p->data)->clear();
127  }
128 };
129 #endif
130 
132 {
133 public:
134  QGraphicsItemCache() : allExposed(false) { }
135 
136  // ItemCoordinateCache only
140 
141  // DeviceCoordinateCache only
142  struct DeviceData {
147  };
149 
150  // List of logical exposed rects
153 
154  // Empty cache
155  void purge();
156 };
157 
159 {
161 public:
162  enum Extra {
167  ExtraBoundingRegionGranularity
168  };
169 
171  NoFlag = 0,
172  AncestorHandlesChildEvents = 0x1,
173  AncestorClipsChildren = 0x2,
174  AncestorIgnoresTransformations = 0x4,
175  AncestorFiltersChildEvents = 0x8
176  };
177 
179  : z(0),
180  opacity(1.),
181  scene(0),
182  parent(0),
183  transformData(0),
184  graphicsEffect(0),
185  index(-1),
186  siblingIndex(-1),
187  itemDepth(-1),
188  focusProxy(0),
189  subFocusItem(0),
190  focusScopeItem(0),
191  imHints(Qt::ImhNone),
192  panelModality(QGraphicsItem::NonModal),
193  acceptedMouseButtons(0x1f),
194  visible(1),
195  explicitlyHidden(0),
196  enabled(1),
197  explicitlyDisabled(0),
198  selected(0),
199  acceptsHover(0),
200  acceptDrops(0),
201  isMemberOfGroup(0),
202  handlesChildEvents(0),
203  itemDiscovered(0),
204  hasCursor(0),
205  ancestorFlags(0),
206  cacheMode(0),
207  hasBoundingRegionGranularity(0),
208  isWidget(0),
209  dirty(0),
210  dirtyChildren(0),
211  localCollisionHack(0),
212  inSetPosHelper(0),
213  needSortChildren(0),
214  allChildrenDirty(0),
215  fullUpdatePending(0),
216  dirtyChildrenBoundingRect(1),
217  flags(0),
218  paintedViewBoundingRectsNeedRepaint(0),
219  dirtySceneTransform(1),
220  geometryChanged(1),
221  inDestructor(0),
222  isObject(0),
223  ignoreVisible(0),
224  ignoreOpacity(0),
225  acceptTouchEvents(0),
226  acceptedTouchBeginEvent(0),
227  filtersDescendantEvents(0),
228  sceneTransformTranslateOnly(0),
229  notifyBoundingRectChanged(0),
230  notifyInvalidated(0),
231  mouseSetsFocus(1),
232  explicitActivate(0),
233  wantsActive(0),
234  holesInSiblingIndex(0),
235  sequentialOrdering(1),
236  updateDueToGraphicsEffect(0),
237  scenePosDescendants(0),
238  pendingPolish(0),
239  mayHaveChildWithGraphicsEffect(0),
240  isDeclarativeItem(0),
241  sendParentChangeNotification(0),
242  globalStackingOrder(-1),
243  q_ptr(0)
244  {
245  }
246 
247  inline virtual ~QGraphicsItemPrivate()
248  { }
249 
250  static const QGraphicsItemPrivate *get(const QGraphicsItem *item)
251  {
252  return item->d_ptr.data();
253  }
255  {
256  return item->d_ptr.data();
257  }
258 
259  void updateChildWithGraphicsEffectFlagRecursively();
260  void updateAncestorFlag(QGraphicsItem::GraphicsItemFlag childFlag,
261  AncestorFlag flag = NoFlag, bool enabled = false, bool root = true);
262  void updateAncestorFlags();
263  void setIsMemberOfGroup(bool enabled);
264  void remapItemPos(QEvent *event, QGraphicsItem *item);
265  QPointF genericMapFromScene(const QPointF &pos, const QWidget *viewport) const;
266  inline bool itemIsUntransformable() const
267  {
269  || (ancestorFlags & AncestorIgnoresTransformations);
270  }
271 
272  void combineTransformToParent(QTransform *x, const QTransform *viewTransform = 0) const;
273  void combineTransformFromParent(QTransform *x, const QTransform *viewTransform = 0) const;
274  virtual void updateSceneTransformFromParent();
275 
276  // ### Qt 5: Remove. Workaround for reimplementation added after Qt 4.4.
277  virtual QVariant inputMethodQueryHelper(Qt::InputMethodQuery query) const;
278  static bool movableAncestorIsSelected(const QGraphicsItem *item);
279 
280  virtual void setPosHelper(const QPointF &pos);
281  void setTransformHelper(const QTransform &transform);
282  void prependGraphicsTransform(QGraphicsTransform *t);
283  void appendGraphicsTransform(QGraphicsTransform *t);
284  void setVisibleHelper(bool newVisible, bool explicitly, bool update = true);
285  void setEnabledHelper(bool newEnabled, bool explicitly, bool update = true);
286  bool discardUpdateRequest(bool ignoreVisibleBit = false,
287  bool ignoreDirtyBit = false, bool ignoreOpacity = false) const;
288  virtual void transformChanged() {}
289  int depth() const;
290 #ifndef QT_NO_GRAPHICSEFFECT
292  OpacityChanged
293  };
294  void invalidateParentGraphicsEffectsRecursively();
295  void invalidateChildGraphicsEffectsRecursively(InvalidateReason reason);
296 #endif //QT_NO_GRAPHICSEFFECT
297  void invalidateDepthRecursively();
298  void resolveDepth();
299  void addChild(QGraphicsItem *child);
300  void removeChild(QGraphicsItem *child);
302  void setParentItemHelper(QGraphicsItem *parent, const QVariant *newParentVariant,
303  const QVariant *thisPointerVariant);
304  void childrenBoundingRectHelper(QTransform *x, QRectF *rect, QGraphicsItem *topMostEffectItem);
305  void initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform,
306  const QRegion &exposedRegion, bool allItems = false) const;
307  QRectF effectiveBoundingRect(QGraphicsItem *topMostEffectItem = 0) const;
308  QRectF sceneEffectiveBoundingRect() const;
309 
310  QRectF effectiveBoundingRect(const QRectF &rect) const;
311 
312  virtual void resolveFont(uint inheritedMask)
313  {
314  for (int i = 0; i < children.size(); ++i)
315  children.at(i)->d_ptr->resolveFont(inheritedMask);
316  }
317 
318  virtual void resolvePalette(uint inheritedMask)
319  {
320  for (int i = 0; i < children.size(); ++i)
321  children.at(i)->d_ptr->resolveFont(inheritedMask);
322  }
323 
324  virtual bool isProxyWidget() const;
325 
326  inline QVariant extra(Extra type) const
327  {
328  for (int i = 0; i < extras.size(); ++i) {
329  const ExtraStruct &extra = extras.at(i);
330  if (extra.type == type)
331  return extra.value;
332  }
333  return QVariant();
334  }
335 
336  inline void setExtra(Extra type, const QVariant &value)
337  {
338  int index = -1;
339  for (int i = 0; i < extras.size(); ++i) {
340  if (extras.at(i).type == type) {
341  index = i;
342  break;
343  }
344  }
345 
346  if (index == -1) {
347  extras << ExtraStruct(type, value);
348  } else {
349  extras[index].value = value;
350  }
351  }
352 
353  inline void unsetExtra(Extra type)
354  {
355  for (int i = 0; i < extras.size(); ++i) {
356  if (extras.at(i).type == type) {
357  extras.removeAt(i);
358  return;
359  }
360  }
361  }
362 
363  struct ExtraStruct {
365  : type(type), value(value)
366  { }
367 
370 
371  bool operator<(Extra extra) const
372  { return type < extra; }
373  };
374 
376 
377  QGraphicsItemCache *maybeExtraItemCache() const;
378  QGraphicsItemCache *extraItemCache() const;
379  void removeExtraItemCache();
380 
381  void updatePaintedViewBoundingRects(bool updateChildren);
382  void ensureSceneTransformRecursive(QGraphicsItem **topMostDirtyItem);
383  inline void ensureSceneTransform()
384  {
385  QGraphicsItem *that = q_func();
386  ensureSceneTransformRecursive(&that);
387  }
388 
390  {
391  ensureSceneTransform();
392  return sceneTransformTranslateOnly;
393  }
394 
396  {
397  for (int i = 0; i < children.size(); ++i)
398  children.at(i)->d_ptr->dirtySceneTransform = 1;
399  }
400 
402  {
403  qreal o = opacity;
404  QGraphicsItem *p = parent;
405  int myFlags = flags;
406  while (p) {
407  int parentFlags = p->d_ptr->flags;
408 
409  // If I have a parent, and I don't ignore my parent's opacity, and my
410  // parent propagates to me, then combine my local opacity with my parent's
411  // effective opacity into my effective opacity.
414  break;
415  }
416 
417  o *= p->d_ptr->opacity;
418  p = p->d_ptr->parent;
419  myFlags = parentFlags;
420  }
421  return o;
422  }
423 
424  inline bool isOpacityNull() const
425  { return (opacity < qreal(0.001)); }
426 
427  static inline bool isOpacityNull(qreal opacity)
428  { return (opacity < qreal(0.001)); }
429 
430  inline bool isFullyTransparent() const
431  {
432  if (isOpacityNull())
433  return true;
434  if (!parent)
435  return false;
436 
437  return isOpacityNull(calcEffectiveOpacity());
438  }
439 
440  inline qreal effectiveOpacity() const {
441  if (!parent || !opacity)
442  return opacity;
443 
444  return calcEffectiveOpacity();
445  }
446 
447  inline qreal combineOpacityFromParent(qreal parentOpacity) const
448  {
449  if (parent && !(flags & QGraphicsItem::ItemIgnoresParentOpacity)
450  && !(parent->d_ptr->flags & QGraphicsItem::ItemDoesntPropagateOpacityToChildren)) {
451  return parentOpacity * opacity;
452  }
453  return opacity;
454  }
455 
456  inline bool childrenCombineOpacity() const
457  {
458  if (!children.size())
459  return true;
461  return false;
462 
463  for (int i = 0; i < children.size(); ++i) {
464  if (children.at(i)->d_ptr->flags & QGraphicsItem::ItemIgnoresParentOpacity)
465  return false;
466  }
467  return true;
468  }
469 
470  inline bool childrenClippedToShape() const
471  { return (flags & QGraphicsItem::ItemClipsChildrenToShape) || children.isEmpty(); }
472 
473  inline bool isInvisible() const
474  {
475  return !visible || (childrenCombineOpacity() && isFullyTransparent());
476  }
477 
478  inline void markParentDirty(bool updateBoundingRect = false);
479 
480  void setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromHide);
481  void clearFocusHelper(bool giveFocusToParent);
482  void setSubFocus(QGraphicsItem *rootItem = 0, QGraphicsItem *stopItem = 0);
483  void clearSubFocus(QGraphicsItem *rootItem = 0, QGraphicsItem *stopItem = 0);
484  void resetFocusProxy();
485  virtual void subFocusItemChange();
486  virtual void focusScopeItemChange(bool isSubFocusItem);
487 
488  static void children_append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item);
489  static int children_count(QDeclarativeListProperty<QGraphicsObject> *list);
490  static QGraphicsObject *children_at(QDeclarativeListProperty<QGraphicsObject> *list, int);
491  static void children_clear(QDeclarativeListProperty<QGraphicsObject> *list);
492 
493  inline QTransform transformToParent() const;
494  inline void ensureSortedChildren();
495  static inline bool insertionOrder(QGraphicsItem *a, QGraphicsItem *b);
496  void ensureSequentialSiblingIndex();
497  inline void sendScenePosChange();
498  virtual void siblingOrderChange();
499 
500  // Private Properties
501  virtual qreal width() const;
502  virtual void setWidth(qreal);
503  virtual void resetWidth();
504 
505  virtual qreal height() const;
506  virtual void setHeight(qreal);
507  virtual void resetHeight();
508 
522  int index;
524  int itemDepth; // Lazily calculated when calling depth().
529  Qt::InputMethodHints imHints;
531 #ifndef QT_NO_GESTURES
533 #endif
534 
535  // Packed 32 bits
560 
561  // Packed 32 bits
576 
577  // New 32 bits
590 
591  // Optional stacking order
594 };
595 
597 {
605 
607  scale(1.0), rotation(0.0),
608  xOrigin(0.0), yOrigin(0.0),
609  onlyTransform(true)
610  { }
611 
612  QTransform computedFullTransform(QTransform *postmultiplyTransform = 0) const
613  {
614  if (onlyTransform) {
615  if (!postmultiplyTransform || postmultiplyTransform->isIdentity())
616  return transform;
617  if (transform.isIdentity())
618  return *postmultiplyTransform;
619  return transform * *postmultiplyTransform;
620  }
621 
622  QTransform x(transform);
623  if (!graphicsTransforms.isEmpty()) {
624  QMatrix4x4 m;
625  for (int i = 0; i < graphicsTransforms.size(); ++i)
626  graphicsTransforms.at(i)->applyTo(&m);
627  x *= m.toTransform();
628  }
629  x.translate(xOrigin, yOrigin);
630  x.rotate(rotation);
631  x.scale(scale, scale);
632  x.translate(-xOrigin, -yOrigin);
633  if (postmultiplyTransform)
634  x *= *postmultiplyTransform;
635  return x;
636  }
637 };
638 
640 {
641  inline QGraphicsItemPaintInfo(const QTransform *const xform1, const QTransform *const xform2,
642  const QTransform *const xform3,
644  QPainter *p, qreal o, bool b1, bool b2)
645  : viewTransform(xform1), transformPtr(xform2), effectTransform(xform3), exposedRegion(r), widget(w),
646  option(opt), painter(p), opacity(o), wasDirtySceneTransform(b1), drawItem(b2)
647  {}
648 
659 };
660 
661 #ifndef QT_NO_GRAPHICSEFFECT
663 {
664 public:
666  : QGraphicsEffectSourcePrivate(), item(i), info(0)
667  {}
668 
669  inline void detach()
670  {
671  item->d_ptr->graphicsEffect = 0;
672  item->prepareGeometryChange();
673  }
674 
675  inline const QGraphicsItem *graphicsItem() const
676  { return item; }
677 
678  inline const QWidget *widget() const
679  { return 0; }
680 
681  inline void update() {
682  item->d_ptr->updateDueToGraphicsEffect = true;
683  item->update();
684  item->d_ptr->updateDueToGraphicsEffect = false;
685  }
686 
688  { item->prepareGeometryChange(); }
689 
690  inline bool isPixmap() const
691  {
692  return item->type() == QGraphicsPixmapItem::Type
693  && !(item->flags() & QGraphicsItem::ItemIsSelectable)
694  && item->d_ptr->children.size() == 0;
695  //|| (item->d_ptr->isObject && qobject_cast<QDeclarativeImage *>(q_func()));
696  }
697 
698  inline const QStyleOption *styleOption() const
699  { return info ? info->option : 0; }
700 
701  inline QRect deviceRect() const
702  {
703  if (!info || !info->widget) {
704  qWarning("QGraphicsEffectSource::deviceRect: Not yet implemented, lacking device context");
705  return QRect();
706  }
707  return info->widget->rect();
708  }
709 
711  void draw(QPainter *);
712  QPixmap pixmap(Qt::CoordinateSystem system,
713  QPoint *offset,
714  QGraphicsEffect::PixmapPadMode mode) const;
715  QRect paddedEffectRect(Qt::CoordinateSystem system, QGraphicsEffect::PixmapPadMode mode, const QRectF &sourceRect, bool *unpadded = 0) const;
716 
720 };
721 #endif //QT_NO_GRAPHICSEFFECT
722 
729 inline bool qt_closestItemFirst(const QGraphicsItem *item1, const QGraphicsItem *item2)
730 {
731  // Siblings? Just check their z-values.
732  const QGraphicsItemPrivate *d1 = item1->d_ptr.data();
733  const QGraphicsItemPrivate *d2 = item2->d_ptr.data();
734  if (d1->parent == d2->parent)
735  return qt_closestLeaf(item1, item2);
736 
737  // Find common ancestor, and each item's ancestor closest to the common
738  // ancestor.
739  int item1Depth = d1->depth();
740  int item2Depth = d2->depth();
741  const QGraphicsItem *p = item1;
742  const QGraphicsItem *t1 = item1;
743  while (item1Depth > item2Depth && (p = p->d_ptr->parent)) {
744  if (p == item2) {
745  // item2 is one of item1's ancestors; item1 is on top
747  }
748  t1 = p;
749  --item1Depth;
750  }
751  p = item2;
752  const QGraphicsItem *t2 = item2;
753  while (item2Depth > item1Depth && (p = p->d_ptr->parent)) {
754  if (p == item1) {
755  // item1 is one of item2's ancestors; item1 is not on top
757  }
758  t2 = p;
759  --item2Depth;
760  }
761 
762  // item1Ancestor is now at the same level as item2Ancestor, but not the same.
763  const QGraphicsItem *p1 = t1;
764  const QGraphicsItem *p2 = t2;
765  while (t1 && t1 != t2) {
766  p1 = t1;
767  p2 = t2;
768  t1 = t1->d_ptr->parent;
769  t2 = t2->d_ptr->parent;
770  }
771 
772  // in case we have a common ancestor, we compare the immediate children in the ancestor's path.
773  // otherwise we compare the respective items' topLevelItems directly.
774  return qt_closestLeaf(p1, p2);
775 }
776 
783 inline bool qt_closestItemLast(const QGraphicsItem *item1, const QGraphicsItem *item2)
784 {
785  return qt_closestItemFirst(item2, item1);
786 }
787 
791 inline bool qt_closestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2)
792 {
793  // Return true if sibling item1 is on top of item2.
794  const QGraphicsItemPrivate *d1 = item1->d_ptr.data();
795  const QGraphicsItemPrivate *d2 = item2->d_ptr.data();
798  if (f1 != f2)
799  return f2;
800  if (d1->z != d2->z)
801  return d1->z > d2->z;
802  return d1->siblingIndex > d2->siblingIndex;
803 }
804 
808 inline bool qt_notclosestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2)
809 { return qt_closestLeaf(item2, item1); }
810 
811 /*
812  return the full transform of the item to the parent. This include the position and all the transform data
813 */
815 {
816  QTransform matrix;
817  combineTransformToParent(&matrix);
818  return matrix;
819 }
820 
825 {
826  if (needSortChildren) {
827  needSortChildren = 0;
828  sequentialOrdering = 1;
829  if (children.isEmpty())
830  return;
831  qSort(children.begin(), children.end(), qt_notclosestLeaf);
832  for (int i = 0; i < children.size(); ++i) {
833  if (children.at(i)->d_ptr->siblingIndex != i) {
834  sequentialOrdering = 0;
835  break;
836  }
837  }
838  }
839 }
840 
845 {
846  return a->d_ptr->siblingIndex < b->d_ptr->siblingIndex;
847 }
848 
852 inline void QGraphicsItemPrivate::markParentDirty(bool updateBoundingRect)
853 {
854  QGraphicsItemPrivate *parentp = this;
855 #ifndef QT_NO_GRAPHICSEFFECT
856  if (updateBoundingRect && parentp->graphicsEffect && !parentp->inSetPosHelper) {
857  parentp->notifyInvalidated = 1;
858  static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func()
859  ->source->d_func())->invalidateCache();
860  }
861 #endif
862  while (parentp->parent) {
863  parentp = parentp->parent->d_ptr.data();
864  parentp->dirtyChildren = 1;
865 
866  if (updateBoundingRect) {
867  parentp->dirtyChildrenBoundingRect = 1;
868  // ### Only do this if the parent's effect applies to the entire subtree.
869  parentp->notifyBoundingRectChanged = 1;
870  }
871 #ifndef QT_NO_GRAPHICSEFFECT
872  if (parentp->graphicsEffect) {
873  if (updateBoundingRect) {
874  static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func()
875  ->source->d_func())->invalidateCache();
876  parentp->notifyInvalidated = 1;
877  }
878  if (parentp->scene && parentp->graphicsEffect->isEnabled()) {
879  parentp->dirty = 1;
880  parentp->fullUpdatePending = 1;
881  }
882  }
883 #endif
884  }
885 }
886 
888 
889 #endif // QT_NO_GRAPHICSVIEW
890 
891 #endif
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
void unsetExtra(Extra type)
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
double d
Definition: qnumeric_p.h:62
const QTransform * transformPtr
CoordinateSystem
Definition: qnamespace.h:1733
quint32 sendParentChangeNotification
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items...
QMap< QPaintDevice *, DeviceData > deviceData
QGraphicsItem * parent
QTransform computedFullTransform(QTransform *postmultiplyTransform=0) const
QGraphicsItem * subFocusItem
qreal combineOpacityFromParent(qreal parentOpacity) const
int type
Definition: qmetatype.cpp:239
double qreal
Definition: qglobal.h:1193
static mach_timebase_info_data_t info
unsigned char c[8]
Definition: qnumeric_p.h:62
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QGraphicsItemEffectSourcePrivate(QGraphicsItem *i)
QGraphicsItem::PanelModality panelModality
EventRef event
QPointer< QWidget > widget
QScopedPointer< QGraphicsItemPrivate > d_ptr
T * data() const
Returns the value of the pointer referenced by this object.
bool hasTranslateOnlySceneTransform()
ExtraStruct(Extra type, QVariant value)
Qt::InputMethodHints imHints
bool isEnabled() const
#define Q_GUI_EXPORT
Definition: qglobal.h:1450
QList< QGraphicsItem ** > focusProxyRefs
QGraphicsItem * q_ptr
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
Definition: qgraphicsitem.h:89
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
bool qt_notclosestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2)
QGraphicsScene * scene
static void qlist_append(QDeclarativeListProperty *p, T *v)
GraphicsItemFlag
This enum describes different flags that you can set on an item to toggle different features in the i...
Definition: qgraphicsitem.h:92
long ASN1_INTEGER_get ASN1_INTEGER * a
const QWidget * widget() const
bool isOpacityNull() const
static int qlist_count(QDeclarativeListProperty *p)
QTransform & translate(qreal dx, qreal dy)
Moves the coordinate system dx along the x axis and dy along the y axis, and returns a reference to t...
Definition: qtransform.cpp:417
static bool isOpacityNull(qreal opacity)
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
const QStyleOption * styleOption() const
bool operator==(const QDeclarativeListProperty &o) const
T *(* AtFunction)(QDeclarativeListProperty< T > *, int)
Synonym for {T *(*)(QDeclarativeListProperty<T> *property, int index)}.
bool childrenClippedToShape() const
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QDeclarativeListProperty(QObject *o, void *d, AppendFunction a, CountFunction c=0, AtFunction t=0, ClearFunction r=0)
bool isInvisible() const
QList< ExtraStruct > extras
bool isIdentity() const
Returns true if the matrix is the identity matrix, otherwise returns false.
Definition: qtransform.h:204
bool qt_closestItemLast(const QGraphicsItem *item1, const QGraphicsItem *item2)
Returns true if item2 is on top of item1.
static const QRectF boundingRect(const QPointF *points, int pointCount)
quint32 hasBoundingRegionGranularity
bool qt_closestItemFirst(const QGraphicsItem *item1, const QGraphicsItem *item2)
Returns true if item1 is on top of item2.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
const QGraphicsItem * graphicsItem() const
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
The QStyleOption class stores the parameters used by QStyle functions.
Definition: qstyleoption.h:67
void invalidateChildrenSceneTransform()
bool itemIsUntransformable() const
virtual void applyTo(QMatrix4x4 *matrix) const =0
This pure virtual method has to be reimplemented in derived classes.
quint32 sceneTransformTranslateOnly
quint32 paintedViewBoundingRectsNeedRepaint
QTransform & rotate(qreal a, Qt::Axis axis=Qt::ZAxis)
Rotates the coordinate system counterclockwise by the given angle about the specified axis and return...
Definition: qtransform.cpp:615
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QGraphicsEffect * graphicsEffect
Q_CORE_EXPORT void qWarning(const char *,...)
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition: qmatrix4x4.h:63
unsigned int uint
Definition: qglobal.h:996
static void qlist_clear(QDeclarativeListProperty *p)
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
virtual void resolvePalette(uint inheritedMask)
const QTransform * viewTransform
static bool insertionOrder(QGraphicsItem *a, QGraphicsItem *b)
PixmapPadMode
This enum describes how the pixmap returned from sourcePixmap should be padded.
int(* CountFunction)(QDeclarativeListProperty< T > *)
Synonym for {int (*)(QDeclarativeListProperty<T> *property)}.
QVariant extra(Extra type) const
virtual ~QGraphicsItemPrivate()
void qSort(RandomAccessIterator start, RandomAccessIterator end)
Definition: qalgorithms.h:177
quint32 mayHaveChildWithGraphicsEffect
QMap< Qt::GestureType, Qt::GestureFlags > gestureContext
QTransform toTransform() const
Returns the conventional Qt 2D transformation matrix that corresponds to this matrix.
InputMethodQuery
Definition: qnamespace.h:1541
void(* ClearFunction)(QDeclarativeListProperty< T > *)
Synonym for {void (*)(QDeclarativeListProperty<T> *property)}.
QStyleOptionGraphicsItem * option
const QTransform * effectTransform
The QPixmapCache::Key class can be used for efficient access to the QPixmapCache. ...
Definition: qpixmapcache.h:61
#define Q_DECLARE_PUBLIC(Class)
Definition: qglobal.h:2477
FocusReason
Definition: qnamespace.h:1521
QPixmapCache::Key key
QList< QGraphicsTransform * > graphicsTransforms
virtual void transformChanged()
QGraphicsItem * focusScopeItem
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
static T * qlist_at(QDeclarativeListProperty *p, int idx)
unsigned int quint32
Definition: qglobal.h:938
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
bool isFullyTransparent() const
bool operator<(Extra extra) const
void setExtra(Extra type, const QVariant &value)
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
Definition: qnamespace.h:54
virtual void resolveFont(uint inheritedMask)
QVector< QRectF > exposed
void(* AppendFunction)(QDeclarativeListProperty< T > *, T *)
Synonym for {void (*)(QDeclarativeListProperty<T> *property, T *value)}.
quint16 index
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
QGraphicsItemPaintInfo * info
TransformData * transformData
QMap< QWidget *, QRect > paintedViewBoundingRects
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
QTransform & scale(qreal sx, qreal sy)
Scales the coordinate system by sx horizontally and sy vertically, and returns a reference to the mat...
Definition: qtransform.cpp:485
QTransform transformToParent() const
QList< QGraphicsItem * > children
QGraphicsItem * focusProxy
PanelModality
This enum specifies the behavior of a modal panel.
The QGraphicsObject class provides a base class for all graphics items that require signals...
void markParentDirty(bool updateBoundingRect=false)
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56
QGraphicsEffectSource * source() const
Returns a pointer to the source, which provides extra context information that can be useful for the ...
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem...
Definition: qstyleoption.h:867
QDeclarativeListProperty(QObject *o, QList< T *> &list)
qreal calcEffectiveOpacity() const
The QDeclarativeListProperty class allows applications to expose list-like properties to QML...
The QGraphicsTransform class is an abstract base class for building advanced transformations on QGrap...
#define enabled
bool childrenCombineOpacity() const
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)
The QMap class is a template class that provides a skip-list-based dictionary.
Definition: qdatastream.h:67
The QGraphicsEffect class is the base class for all graphics effects.
bool qt_closestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2)
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
qreal effectiveOpacity() const