author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 16 Apr 2010 15:50:13 +0300 | |
changeset 18 | 2f34d5167611 |
parent 3 | 41300fa6a67c |
child 19 | fcece45ef507 |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the QtGui module of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
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> |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
64 |
#include <qgraphicseffect.h> |
0 | 65 |
|
66 |
#include <QtCore/qpoint.h> |
|
67 |
||
68 |
#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW |
|
69 |
||
70 |
QT_BEGIN_NAMESPACE |
|
71 |
||
72 |
class QGraphicsItemPrivate; |
|
73 |
||
74 |
class QGraphicsItemCache |
|
75 |
{ |
|
76 |
public: |
|
77 |
QGraphicsItemCache() : allExposed(false) { } |
|
78 |
||
79 |
// ItemCoordinateCache only |
|
80 |
QRect boundingRect; |
|
81 |
QSize fixedSize; |
|
82 |
QPixmapCache::Key key; |
|
83 |
||
84 |
// DeviceCoordinateCache only |
|
85 |
struct DeviceData { |
|
86 |
DeviceData() {} |
|
87 |
QTransform lastTransform; |
|
88 |
QPoint cacheIndent; |
|
89 |
QPixmapCache::Key key; |
|
90 |
}; |
|
91 |
QMap<QPaintDevice *, DeviceData> deviceData; |
|
92 |
||
93 |
// List of logical exposed rects |
|
94 |
QVector<QRectF> exposed; |
|
95 |
bool allExposed; |
|
96 |
||
97 |
// Empty cache |
|
98 |
void purge(); |
|
99 |
}; |
|
100 |
||
101 |
class Q_GUI_EXPORT QGraphicsItemPrivate |
|
102 |
{ |
|
103 |
Q_DECLARE_PUBLIC(QGraphicsItem) |
|
104 |
public: |
|
105 |
enum Extra { |
|
106 |
ExtraToolTip, |
|
107 |
ExtraCursor, |
|
108 |
ExtraCacheData, |
|
109 |
ExtraMaxDeviceCoordCacheSize, |
|
110 |
ExtraBoundingRegionGranularity |
|
111 |
}; |
|
112 |
||
113 |
enum AncestorFlag { |
|
114 |
NoFlag = 0, |
|
115 |
AncestorHandlesChildEvents = 0x1, |
|
116 |
AncestorClipsChildren = 0x2, |
|
117 |
AncestorIgnoresTransformations = 0x4, |
|
118 |
AncestorFiltersChildEvents = 0x8 |
|
119 |
}; |
|
120 |
||
121 |
inline QGraphicsItemPrivate() |
|
122 |
: z(0), |
|
123 |
opacity(1.), |
|
124 |
scene(0), |
|
125 |
parent(0), |
|
126 |
transformData(0), |
|
127 |
graphicsEffect(0), |
|
128 |
index(-1), |
|
129 |
siblingIndex(-1), |
|
130 |
itemDepth(-1), |
|
131 |
focusProxy(0), |
|
132 |
subFocusItem(0), |
|
133 |
focusScopeItem(0), |
|
134 |
imHints(Qt::ImhNone), |
|
135 |
panelModality(QGraphicsItem::NonModal), |
|
136 |
acceptedMouseButtons(0x1f), |
|
137 |
visible(1), |
|
138 |
explicitlyHidden(0), |
|
139 |
enabled(1), |
|
140 |
explicitlyDisabled(0), |
|
141 |
selected(0), |
|
142 |
acceptsHover(0), |
|
143 |
acceptDrops(0), |
|
144 |
isMemberOfGroup(0), |
|
145 |
handlesChildEvents(0), |
|
146 |
itemDiscovered(0), |
|
147 |
hasCursor(0), |
|
148 |
ancestorFlags(0), |
|
149 |
cacheMode(0), |
|
150 |
hasBoundingRegionGranularity(0), |
|
151 |
isWidget(0), |
|
152 |
dirty(0), |
|
153 |
dirtyChildren(0), |
|
154 |
localCollisionHack(0), |
|
155 |
inSetPosHelper(0), |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
156 |
needSortChildren(0), |
0 | 157 |
allChildrenDirty(0), |
158 |
fullUpdatePending(0), |
|
159 |
flags(0), |
|
160 |
dirtyChildrenBoundingRect(1), |
|
161 |
paintedViewBoundingRectsNeedRepaint(0), |
|
162 |
dirtySceneTransform(1), |
|
163 |
geometryChanged(1), |
|
164 |
inDestructor(0), |
|
165 |
isObject(0), |
|
166 |
ignoreVisible(0), |
|
167 |
ignoreOpacity(0), |
|
168 |
acceptTouchEvents(0), |
|
169 |
acceptedTouchBeginEvent(0), |
|
170 |
filtersDescendantEvents(0), |
|
171 |
sceneTransformTranslateOnly(0), |
|
172 |
notifyBoundingRectChanged(0), |
|
173 |
notifyInvalidated(0), |
|
174 |
mouseSetsFocus(1), |
|
175 |
explicitActivate(0), |
|
176 |
wantsActive(0), |
|
177 |
holesInSiblingIndex(0), |
|
178 |
sequentialOrdering(1), |
|
179 |
updateDueToGraphicsEffect(0), |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
180 |
scenePosDescendants(0), |
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
181 |
pendingPolish(0), |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
182 |
mayHaveChildWithGraphicsEffect(0), |
0 | 183 |
globalStackingOrder(-1), |
184 |
q_ptr(0) |
|
185 |
{ |
|
186 |
} |
|
187 |
||
188 |
inline virtual ~QGraphicsItemPrivate() |
|
189 |
{ } |
|
190 |
||
191 |
static const QGraphicsItemPrivate *get(const QGraphicsItem *item) |
|
192 |
{ |
|
193 |
return item->d_ptr.data(); |
|
194 |
} |
|
195 |
static QGraphicsItemPrivate *get(QGraphicsItem *item) |
|
196 |
{ |
|
197 |
return item->d_ptr.data(); |
|
198 |
} |
|
199 |
||
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
200 |
void updateChildWithGraphicsEffectFlagRecursively(); |
0 | 201 |
void updateAncestorFlag(QGraphicsItem::GraphicsItemFlag childFlag, |
202 |
AncestorFlag flag = NoFlag, bool enabled = false, bool root = true); |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
203 |
void updateAncestorFlags(); |
0 | 204 |
void setIsMemberOfGroup(bool enabled); |
205 |
void remapItemPos(QEvent *event, QGraphicsItem *item); |
|
206 |
QPointF genericMapFromScene(const QPointF &pos, const QWidget *viewport) const; |
|
207 |
inline bool itemIsUntransformable() const |
|
208 |
{ |
|
209 |
return (flags & QGraphicsItem::ItemIgnoresTransformations) |
|
210 |
|| (ancestorFlags & AncestorIgnoresTransformations); |
|
211 |
} |
|
212 |
||
213 |
void combineTransformToParent(QTransform *x, const QTransform *viewTransform = 0) const; |
|
214 |
void combineTransformFromParent(QTransform *x, const QTransform *viewTransform = 0) const; |
|
215 |
virtual void updateSceneTransformFromParent(); |
|
216 |
||
217 |
// ### Qt 5: Remove. Workaround for reimplementation added after Qt 4.4. |
|
218 |
virtual QVariant inputMethodQueryHelper(Qt::InputMethodQuery query) const; |
|
219 |
static bool movableAncestorIsSelected(const QGraphicsItem *item); |
|
220 |
||
221 |
virtual void setPosHelper(const QPointF &pos); |
|
222 |
void setTransformHelper(const QTransform &transform); |
|
223 |
void appendGraphicsTransform(QGraphicsTransform *t); |
|
224 |
void setVisibleHelper(bool newVisible, bool explicitly, bool update = true); |
|
225 |
void setEnabledHelper(bool newEnabled, bool explicitly, bool update = true); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
226 |
bool discardUpdateRequest(bool ignoreVisibleBit = false, |
0 | 227 |
bool ignoreDirtyBit = false, bool ignoreOpacity = false) const; |
228 |
int depth() const; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
229 |
#ifndef QT_NO_GRAPHICSEFFECT |
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
230 |
enum InvalidateReason { |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
231 |
OpacityChanged |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
232 |
}; |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
233 |
void invalidateParentGraphicsEffectsRecursively(); |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
234 |
void invalidateChildGraphicsEffectsRecursively(InvalidateReason reason); |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
235 |
#endif //QT_NO_GRAPHICSEFFECT |
0 | 236 |
void invalidateDepthRecursively(); |
237 |
void resolveDepth(); |
|
238 |
void addChild(QGraphicsItem *child); |
|
239 |
void removeChild(QGraphicsItem *child); |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
240 |
void setParentItemHelper(QGraphicsItem *parent, const QVariant *newParentVariant, |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
241 |
const QVariant *thisPointerVariant); |
0 | 242 |
void childrenBoundingRectHelper(QTransform *x, QRectF *rect); |
243 |
void initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform, |
|
244 |
const QRegion &exposedRegion, bool allItems = false) const; |
|
245 |
QRectF effectiveBoundingRect() const; |
|
246 |
QRectF sceneEffectiveBoundingRect() const; |
|
247 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
248 |
QRectF effectiveBoundingRect(const QRectF &rect) const; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
249 |
|
0 | 250 |
virtual void resolveFont(uint inheritedMask) |
251 |
{ |
|
252 |
for (int i = 0; i < children.size(); ++i) |
|
253 |
children.at(i)->d_ptr->resolveFont(inheritedMask); |
|
254 |
} |
|
255 |
||
256 |
virtual void resolvePalette(uint inheritedMask) |
|
257 |
{ |
|
258 |
for (int i = 0; i < children.size(); ++i) |
|
259 |
children.at(i)->d_ptr->resolveFont(inheritedMask); |
|
260 |
} |
|
261 |
||
262 |
virtual bool isProxyWidget() const; |
|
263 |
||
264 |
inline QVariant extra(Extra type) const |
|
265 |
{ |
|
266 |
for (int i = 0; i < extras.size(); ++i) { |
|
267 |
const ExtraStruct &extra = extras.at(i); |
|
268 |
if (extra.type == type) |
|
269 |
return extra.value; |
|
270 |
} |
|
271 |
return QVariant(); |
|
272 |
} |
|
273 |
||
274 |
inline void setExtra(Extra type, const QVariant &value) |
|
275 |
{ |
|
276 |
int index = -1; |
|
277 |
for (int i = 0; i < extras.size(); ++i) { |
|
278 |
if (extras.at(i).type == type) { |
|
279 |
index = i; |
|
280 |
break; |
|
281 |
} |
|
282 |
} |
|
283 |
||
284 |
if (index == -1) { |
|
285 |
extras << ExtraStruct(type, value); |
|
286 |
} else { |
|
287 |
extras[index].value = value; |
|
288 |
} |
|
289 |
} |
|
290 |
||
291 |
inline void unsetExtra(Extra type) |
|
292 |
{ |
|
293 |
for (int i = 0; i < extras.size(); ++i) { |
|
294 |
if (extras.at(i).type == type) { |
|
295 |
extras.removeAt(i); |
|
296 |
return; |
|
297 |
} |
|
298 |
} |
|
299 |
} |
|
300 |
||
301 |
struct ExtraStruct { |
|
302 |
ExtraStruct(Extra type, QVariant value) |
|
303 |
: type(type), value(value) |
|
304 |
{ } |
|
305 |
||
306 |
Extra type; |
|
307 |
QVariant value; |
|
308 |
||
309 |
bool operator<(Extra extra) const |
|
310 |
{ return type < extra; } |
|
311 |
}; |
|
312 |
||
313 |
QList<ExtraStruct> extras; |
|
314 |
||
315 |
QGraphicsItemCache *maybeExtraItemCache() const; |
|
316 |
QGraphicsItemCache *extraItemCache() const; |
|
317 |
void removeExtraItemCache(); |
|
318 |
||
319 |
void ensureSceneTransformRecursive(QGraphicsItem **topMostDirtyItem); |
|
320 |
inline void ensureSceneTransform() |
|
321 |
{ |
|
322 |
QGraphicsItem *that = q_func(); |
|
323 |
ensureSceneTransformRecursive(&that); |
|
324 |
} |
|
325 |
||
326 |
inline bool hasTranslateOnlySceneTransform() |
|
327 |
{ |
|
328 |
ensureSceneTransform(); |
|
329 |
return sceneTransformTranslateOnly; |
|
330 |
} |
|
331 |
||
332 |
inline void invalidateChildrenSceneTransform() |
|
333 |
{ |
|
334 |
for (int i = 0; i < children.size(); ++i) |
|
335 |
children.at(i)->d_ptr->dirtySceneTransform = 1; |
|
336 |
} |
|
337 |
||
338 |
inline qreal calcEffectiveOpacity() const |
|
339 |
{ |
|
340 |
qreal o = opacity; |
|
341 |
QGraphicsItem *p = parent; |
|
342 |
int myFlags = flags; |
|
343 |
while (p) { |
|
344 |
int parentFlags = p->d_ptr->flags; |
|
345 |
||
346 |
// If I have a parent, and I don't ignore my parent's opacity, and my |
|
347 |
// parent propagates to me, then combine my local opacity with my parent's |
|
348 |
// effective opacity into my effective opacity. |
|
349 |
if ((myFlags & QGraphicsItem::ItemIgnoresParentOpacity) |
|
350 |
|| (parentFlags & QGraphicsItem::ItemDoesntPropagateOpacityToChildren)) { |
|
351 |
break; |
|
352 |
} |
|
353 |
||
354 |
o *= p->d_ptr->opacity; |
|
355 |
p = p->d_ptr->parent; |
|
356 |
myFlags = parentFlags; |
|
357 |
} |
|
358 |
return o; |
|
359 |
} |
|
360 |
||
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
361 |
inline bool isOpacityNull() const |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
362 |
{ return (opacity < qreal(0.001)); } |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
363 |
|
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
364 |
static inline bool isOpacityNull(qreal opacity) |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
365 |
{ return (opacity < qreal(0.001)); } |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
366 |
|
0 | 367 |
inline bool isFullyTransparent() const |
368 |
{ |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
369 |
if (isOpacityNull()) |
0 | 370 |
return true; |
371 |
if (!parent) |
|
372 |
return false; |
|
373 |
||
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
374 |
return isOpacityNull(calcEffectiveOpacity()); |
0 | 375 |
} |
376 |
||
377 |
inline qreal effectiveOpacity() const { |
|
378 |
if (!parent || !opacity) |
|
379 |
return opacity; |
|
380 |
||
381 |
return calcEffectiveOpacity(); |
|
382 |
} |
|
383 |
||
384 |
inline qreal combineOpacityFromParent(qreal parentOpacity) const |
|
385 |
{ |
|
386 |
if (parent && !(flags & QGraphicsItem::ItemIgnoresParentOpacity) |
|
387 |
&& !(parent->d_ptr->flags & QGraphicsItem::ItemDoesntPropagateOpacityToChildren)) { |
|
388 |
return parentOpacity * opacity; |
|
389 |
} |
|
390 |
return opacity; |
|
391 |
} |
|
392 |
||
393 |
inline bool childrenCombineOpacity() const |
|
394 |
{ |
|
395 |
if (!children.size()) |
|
396 |
return true; |
|
397 |
if (flags & QGraphicsItem::ItemDoesntPropagateOpacityToChildren) |
|
398 |
return false; |
|
399 |
||
400 |
for (int i = 0; i < children.size(); ++i) { |
|
401 |
if (children.at(i)->d_ptr->flags & QGraphicsItem::ItemIgnoresParentOpacity) |
|
402 |
return false; |
|
403 |
} |
|
404 |
return true; |
|
405 |
} |
|
406 |
||
407 |
inline bool childrenClippedToShape() const |
|
408 |
{ return (flags & QGraphicsItem::ItemClipsChildrenToShape) || children.isEmpty(); } |
|
409 |
||
410 |
inline bool isInvisible() const |
|
411 |
{ |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
412 |
return !visible || (childrenCombineOpacity() && isFullyTransparent()); |
0 | 413 |
} |
414 |
||
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
415 |
inline void markParentDirty(bool updateBoundingRect = false); |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
416 |
|
0 | 417 |
void setFocusHelper(Qt::FocusReason focusReason, bool climb); |
418 |
void setSubFocus(QGraphicsItem *rootItem = 0); |
|
419 |
void clearSubFocus(QGraphicsItem *rootItem = 0); |
|
420 |
void resetFocusProxy(); |
|
421 |
virtual void subFocusItemChange(); |
|
422 |
||
423 |
inline QTransform transformToParent() const; |
|
424 |
inline void ensureSortedChildren(); |
|
425 |
static inline bool insertionOrder(QGraphicsItem *a, QGraphicsItem *b); |
|
426 |
void ensureSequentialSiblingIndex(); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
427 |
inline void sendScenePosChange(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
428 |
virtual void siblingOrderChange(); |
0 | 429 |
|
430 |
QRectF childrenBoundingRect; |
|
431 |
QRectF needsRepaint; |
|
432 |
QMap<QWidget *, QRect> paintedViewBoundingRects; |
|
433 |
QPointF pos; |
|
434 |
qreal z; |
|
435 |
qreal opacity; |
|
436 |
QGraphicsScene *scene; |
|
437 |
QGraphicsItem *parent; |
|
438 |
QList<QGraphicsItem *> children; |
|
439 |
struct TransformData; |
|
440 |
TransformData *transformData; |
|
441 |
QGraphicsEffect *graphicsEffect; |
|
442 |
QTransform sceneTransform; |
|
443 |
int index; |
|
444 |
int siblingIndex; |
|
445 |
int itemDepth; // Lazily calculated when calling depth(). |
|
446 |
QGraphicsItem *focusProxy; |
|
447 |
QList<QGraphicsItem **> focusProxyRefs; |
|
448 |
QGraphicsItem *subFocusItem; |
|
449 |
QGraphicsItem *focusScopeItem; |
|
450 |
Qt::InputMethodHints imHints; |
|
451 |
QGraphicsItem::PanelModality panelModality; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
452 |
QMap<Qt::GestureType, Qt::GestureFlags> gestureContext; |
0 | 453 |
|
454 |
// Packed 32 bits |
|
455 |
quint32 acceptedMouseButtons : 5; |
|
456 |
quint32 visible : 1; |
|
457 |
quint32 explicitlyHidden : 1; |
|
458 |
quint32 enabled : 1; |
|
459 |
quint32 explicitlyDisabled : 1; |
|
460 |
quint32 selected : 1; |
|
461 |
quint32 acceptsHover : 1; |
|
462 |
quint32 acceptDrops : 1; |
|
463 |
quint32 isMemberOfGroup : 1; |
|
464 |
quint32 handlesChildEvents : 1; |
|
465 |
quint32 itemDiscovered : 1; |
|
466 |
quint32 hasCursor : 1; |
|
467 |
quint32 ancestorFlags : 4; |
|
468 |
quint32 cacheMode : 2; |
|
469 |
quint32 hasBoundingRegionGranularity : 1; |
|
470 |
quint32 isWidget : 1; |
|
471 |
quint32 dirty : 1; |
|
472 |
quint32 dirtyChildren : 1; |
|
473 |
quint32 localCollisionHack : 1; |
|
474 |
quint32 inSetPosHelper : 1; |
|
475 |
quint32 needSortChildren : 1; |
|
476 |
quint32 allChildrenDirty : 1; |
|
477 |
||
478 |
// Packed 32 bits |
|
479 |
quint32 fullUpdatePending : 1; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
480 |
quint32 flags : 17; |
0 | 481 |
quint32 dirtyChildrenBoundingRect : 1; |
482 |
quint32 paintedViewBoundingRectsNeedRepaint : 1; |
|
483 |
quint32 dirtySceneTransform : 1; |
|
484 |
quint32 geometryChanged : 1; |
|
485 |
quint32 inDestructor : 1; |
|
486 |
quint32 isObject : 1; |
|
487 |
quint32 ignoreVisible : 1; |
|
488 |
quint32 ignoreOpacity : 1; |
|
489 |
quint32 acceptTouchEvents : 1; |
|
490 |
quint32 acceptedTouchBeginEvent : 1; |
|
491 |
quint32 filtersDescendantEvents : 1; |
|
492 |
quint32 sceneTransformTranslateOnly : 1; |
|
493 |
quint32 notifyBoundingRectChanged : 1; |
|
494 |
quint32 notifyInvalidated : 1; |
|
495 |
||
496 |
// New 32 bits |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
497 |
quint32 mouseSetsFocus : 1; |
0 | 498 |
quint32 explicitActivate : 1; |
499 |
quint32 wantsActive : 1; |
|
500 |
quint32 holesInSiblingIndex : 1; |
|
501 |
quint32 sequentialOrdering : 1; |
|
502 |
quint32 updateDueToGraphicsEffect : 1; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
503 |
quint32 scenePosDescendants : 1; |
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
504 |
quint32 pendingPolish : 1; |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
505 |
quint32 mayHaveChildWithGraphicsEffect : 1; |
0 | 506 |
|
507 |
// Optional stacking order |
|
508 |
int globalStackingOrder; |
|
509 |
QGraphicsItem *q_ptr; |
|
510 |
}; |
|
511 |
||
512 |
struct QGraphicsItemPrivate::TransformData |
|
513 |
{ |
|
514 |
QTransform transform; |
|
515 |
qreal scale; |
|
516 |
qreal rotation; |
|
517 |
qreal xOrigin; |
|
518 |
qreal yOrigin; |
|
519 |
QList<QGraphicsTransform *> graphicsTransforms; |
|
520 |
bool onlyTransform; |
|
521 |
||
522 |
TransformData() : |
|
523 |
scale(1.0), rotation(0.0), |
|
524 |
xOrigin(0.0), yOrigin(0.0), |
|
525 |
onlyTransform(true) |
|
526 |
{ } |
|
527 |
||
528 |
QTransform computedFullTransform(QTransform *postmultiplyTransform = 0) const |
|
529 |
{ |
|
530 |
if (onlyTransform) { |
|
531 |
if (!postmultiplyTransform || postmultiplyTransform->isIdentity()) |
|
532 |
return transform; |
|
533 |
if (transform.isIdentity()) |
|
534 |
return *postmultiplyTransform; |
|
535 |
return transform * *postmultiplyTransform; |
|
536 |
} |
|
537 |
||
538 |
QTransform x(transform); |
|
539 |
if (!graphicsTransforms.isEmpty()) { |
|
540 |
QMatrix4x4 m; |
|
541 |
for (int i = 0; i < graphicsTransforms.size(); ++i) |
|
542 |
graphicsTransforms.at(i)->applyTo(&m); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
543 |
x *= m.toTransform(); |
0 | 544 |
} |
545 |
x.translate(xOrigin, yOrigin); |
|
546 |
x.rotate(rotation); |
|
547 |
x.scale(scale, scale); |
|
548 |
x.translate(-xOrigin, -yOrigin); |
|
549 |
if (postmultiplyTransform) |
|
550 |
x *= *postmultiplyTransform; |
|
551 |
return x; |
|
552 |
} |
|
553 |
}; |
|
554 |
||
555 |
struct QGraphicsItemPaintInfo |
|
556 |
{ |
|
557 |
inline QGraphicsItemPaintInfo(const QTransform *const xform1, const QTransform *const xform2, |
|
558 |
const QTransform *const xform3, |
|
559 |
QRegion *r, QWidget *w, QStyleOptionGraphicsItem *opt, |
|
560 |
QPainter *p, qreal o, bool b1, bool b2) |
|
561 |
: viewTransform(xform1), transformPtr(xform2), effectTransform(xform3), exposedRegion(r), widget(w), |
|
562 |
option(opt), painter(p), opacity(o), wasDirtySceneTransform(b1), drawItem(b2) |
|
563 |
{} |
|
564 |
||
565 |
const QTransform *viewTransform; |
|
566 |
const QTransform *transformPtr; |
|
567 |
const QTransform *effectTransform; |
|
568 |
QRegion *exposedRegion; |
|
569 |
QWidget *widget; |
|
570 |
QStyleOptionGraphicsItem *option; |
|
571 |
QPainter *painter; |
|
572 |
qreal opacity; |
|
573 |
quint32 wasDirtySceneTransform : 1; |
|
574 |
quint32 drawItem : 1; |
|
575 |
}; |
|
576 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
577 |
#ifndef QT_NO_GRAPHICSEFFECT |
0 | 578 |
class QGraphicsItemEffectSourcePrivate : public QGraphicsEffectSourcePrivate |
579 |
{ |
|
580 |
public: |
|
581 |
QGraphicsItemEffectSourcePrivate(QGraphicsItem *i) |
|
582 |
: QGraphicsEffectSourcePrivate(), item(i), info(0) |
|
583 |
{} |
|
584 |
||
585 |
inline void detach() |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
586 |
{ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
587 |
item->d_ptr->graphicsEffect = 0; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
588 |
item->prepareGeometryChange(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
589 |
} |
0 | 590 |
|
591 |
inline const QGraphicsItem *graphicsItem() const |
|
592 |
{ return item; } |
|
593 |
||
594 |
inline const QWidget *widget() const |
|
595 |
{ return 0; } |
|
596 |
||
597 |
inline void update() { |
|
598 |
item->d_ptr->updateDueToGraphicsEffect = true; |
|
599 |
item->update(); |
|
600 |
item->d_ptr->updateDueToGraphicsEffect = false; |
|
601 |
} |
|
602 |
||
603 |
inline void effectBoundingRectChanged() |
|
604 |
{ item->prepareGeometryChange(); } |
|
605 |
||
606 |
inline bool isPixmap() const |
|
607 |
{ |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
608 |
return item->type() == QGraphicsPixmapItem::Type |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
609 |
&& !(item->flags() & QGraphicsItem::ItemIsSelectable) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
610 |
&& item->d_ptr->children.size() == 0; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
611 |
//|| (item->d_ptr->isObject && qobject_cast<QmlGraphicsImage *>(q_func())); |
0 | 612 |
} |
613 |
||
614 |
inline const QStyleOption *styleOption() const |
|
615 |
{ return info ? info->option : 0; } |
|
616 |
||
617 |
inline QRect deviceRect() const |
|
618 |
{ |
|
619 |
if (!info || !info->widget) { |
|
620 |
qWarning("QGraphicsEffectSource::deviceRect: Not yet implemented, lacking device context"); |
|
621 |
return QRect(); |
|
622 |
} |
|
623 |
return info->widget->rect(); |
|
624 |
} |
|
625 |
||
626 |
QRectF boundingRect(Qt::CoordinateSystem system) const; |
|
627 |
void draw(QPainter *); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
628 |
QPixmap pixmap(Qt::CoordinateSystem system, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
629 |
QPoint *offset, |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
630 |
QGraphicsEffect::PixmapPadMode mode) const; |
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
631 |
QRect paddedEffectRect(Qt::CoordinateSystem system, QGraphicsEffect::PixmapPadMode mode, const QRectF &sourceRect, bool *unpadded = 0) const; |
0 | 632 |
|
633 |
QGraphicsItem *item; |
|
634 |
QGraphicsItemPaintInfo *info; |
|
635 |
QTransform lastEffectTransform; |
|
636 |
}; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
637 |
#endif //QT_NO_GRAPHICSEFFECT |
0 | 638 |
|
639 |
/*! |
|
640 |
Returns true if \a item1 is on top of \a item2. |
|
641 |
The items dont need to be siblings. |
|
642 |
||
643 |
\internal |
|
644 |
*/ |
|
645 |
inline bool qt_closestItemFirst(const QGraphicsItem *item1, const QGraphicsItem *item2) |
|
646 |
{ |
|
647 |
// Siblings? Just check their z-values. |
|
648 |
const QGraphicsItemPrivate *d1 = item1->d_ptr.data(); |
|
649 |
const QGraphicsItemPrivate *d2 = item2->d_ptr.data(); |
|
650 |
if (d1->parent == d2->parent) |
|
651 |
return qt_closestLeaf(item1, item2); |
|
652 |
||
653 |
// Find common ancestor, and each item's ancestor closest to the common |
|
654 |
// ancestor. |
|
655 |
int item1Depth = d1->depth(); |
|
656 |
int item2Depth = d2->depth(); |
|
657 |
const QGraphicsItem *p = item1; |
|
658 |
const QGraphicsItem *t1 = item1; |
|
659 |
while (item1Depth > item2Depth && (p = p->d_ptr->parent)) { |
|
660 |
if (p == item2) { |
|
661 |
// item2 is one of item1's ancestors; item1 is on top |
|
662 |
return !(t1->d_ptr->flags & QGraphicsItem::ItemStacksBehindParent); |
|
663 |
} |
|
664 |
t1 = p; |
|
665 |
--item1Depth; |
|
666 |
} |
|
667 |
p = item2; |
|
668 |
const QGraphicsItem *t2 = item2; |
|
669 |
while (item2Depth > item1Depth && (p = p->d_ptr->parent)) { |
|
670 |
if (p == item1) { |
|
671 |
// item1 is one of item2's ancestors; item1 is not on top |
|
672 |
return (t2->d_ptr->flags & QGraphicsItem::ItemStacksBehindParent); |
|
673 |
} |
|
674 |
t2 = p; |
|
675 |
--item2Depth; |
|
676 |
} |
|
677 |
||
678 |
// item1Ancestor is now at the same level as item2Ancestor, but not the same. |
|
679 |
const QGraphicsItem *p1 = t1; |
|
680 |
const QGraphicsItem *p2 = t2; |
|
681 |
while (t1 && t1 != t2) { |
|
682 |
p1 = t1; |
|
683 |
p2 = t2; |
|
684 |
t1 = t1->d_ptr->parent; |
|
685 |
t2 = t2->d_ptr->parent; |
|
686 |
} |
|
687 |
||
688 |
// in case we have a common ancestor, we compare the immediate children in the ancestor's path. |
|
689 |
// otherwise we compare the respective items' topLevelItems directly. |
|
690 |
return qt_closestLeaf(p1, p2); |
|
691 |
} |
|
692 |
||
693 |
/*! |
|
694 |
Returns true if \a item2 is on top of \a item1. |
|
695 |
The items dont need to be siblings. |
|
696 |
||
697 |
\internal |
|
698 |
*/ |
|
699 |
inline bool qt_closestItemLast(const QGraphicsItem *item1, const QGraphicsItem *item2) |
|
700 |
{ |
|
701 |
return qt_closestItemFirst(item2, item1); |
|
702 |
} |
|
703 |
||
704 |
/*! |
|
705 |
\internal |
|
706 |
*/ |
|
707 |
inline bool qt_closestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2) |
|
708 |
{ |
|
709 |
// Return true if sibling item1 is on top of item2. |
|
710 |
const QGraphicsItemPrivate *d1 = item1->d_ptr.data(); |
|
711 |
const QGraphicsItemPrivate *d2 = item2->d_ptr.data(); |
|
712 |
bool f1 = d1->flags & QGraphicsItem::ItemStacksBehindParent; |
|
713 |
bool f2 = d2->flags & QGraphicsItem::ItemStacksBehindParent; |
|
714 |
if (f1 != f2) |
|
715 |
return f2; |
|
716 |
if (d1->z != d2->z) |
|
717 |
return d1->z > d2->z; |
|
718 |
return d1->siblingIndex > d2->siblingIndex; |
|
719 |
} |
|
720 |
||
721 |
/*! |
|
722 |
\internal |
|
723 |
*/ |
|
724 |
inline bool qt_notclosestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2) |
|
725 |
{ return qt_closestLeaf(item2, item1); } |
|
726 |
||
727 |
/* |
|
728 |
return the full transform of the item to the parent. This include the position and all the transform data |
|
729 |
*/ |
|
730 |
inline QTransform QGraphicsItemPrivate::transformToParent() const |
|
731 |
{ |
|
732 |
QTransform matrix; |
|
733 |
combineTransformToParent(&matrix); |
|
734 |
return matrix; |
|
735 |
} |
|
736 |
||
737 |
/*! |
|
738 |
\internal |
|
739 |
*/ |
|
740 |
inline void QGraphicsItemPrivate::ensureSortedChildren() |
|
741 |
{ |
|
742 |
if (needSortChildren) { |
|
743 |
needSortChildren = 0; |
|
744 |
sequentialOrdering = 1; |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
745 |
if (children.isEmpty()) |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
746 |
return; |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
747 |
qSort(children.begin(), children.end(), qt_notclosestLeaf); |
0 | 748 |
for (int i = 0; i < children.size(); ++i) { |
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
749 |
if (children.at(i)->d_ptr->siblingIndex != i) { |
0 | 750 |
sequentialOrdering = 0; |
751 |
break; |
|
752 |
} |
|
753 |
} |
|
754 |
} |
|
755 |
} |
|
756 |
||
757 |
/*! |
|
758 |
\internal |
|
759 |
*/ |
|
760 |
inline bool QGraphicsItemPrivate::insertionOrder(QGraphicsItem *a, QGraphicsItem *b) |
|
761 |
{ |
|
762 |
return a->d_ptr->siblingIndex < b->d_ptr->siblingIndex; |
|
763 |
} |
|
764 |
||
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
765 |
/*! |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
766 |
\internal |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
767 |
*/ |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
768 |
inline void QGraphicsItemPrivate::markParentDirty(bool updateBoundingRect) |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
769 |
{ |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
770 |
QGraphicsItemPrivate *parentp = this; |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
771 |
while (parentp->parent) { |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
772 |
parentp = parentp->parent->d_ptr.data(); |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
773 |
parentp->dirtyChildren = 1; |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
774 |
|
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
775 |
if (updateBoundingRect) { |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
776 |
parentp->dirtyChildrenBoundingRect = 1; |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
777 |
// ### Only do this if the parent's effect applies to the entire subtree. |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
778 |
parentp->notifyBoundingRectChanged = 1; |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
779 |
} |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
780 |
#ifndef QT_NO_GRAPHICSEFFECT |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
781 |
if (parentp->graphicsEffect) { |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
782 |
if (updateBoundingRect) { |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
783 |
parentp->notifyInvalidated = 1; |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
784 |
static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func() |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
785 |
->source->d_func())->invalidateCache(); |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
786 |
} |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
787 |
if (parentp->graphicsEffect->isEnabled()) { |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
788 |
parentp->dirty = 1; |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
789 |
parentp->fullUpdatePending = 1; |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
790 |
} |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
791 |
} |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
792 |
#endif |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
793 |
} |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
794 |
} |
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
795 |
|
0 | 796 |
QT_END_NAMESPACE |
797 |
||
798 |
#endif // QT_NO_GRAPHICSVIEW |
|
799 |
||
800 |
#endif |