Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/graphicsview/qgraphicsitem.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5151    This includes defining the item's geometry, collision detection, its
    5252    painting implementation and item interaction through its event handlers.
    53     QGraphicsItem is part of \l{The Graphics View Framework}
     53    QGraphicsItem is part of the \l{Graphics View Framework}
    5454
    5555    \image graphicsview-items.png
     
    134134    \img graphicsview-parentchild.png
    135135
    136     \section1 Transformation
     136    \target Transformations
     137    \section1 Transformations
    137138
    138139    QGraphicsItem supports projective transformations in addition to its base
     
    265266    user's convenience.
    266267
    267     \sa QGraphicsScene, QGraphicsView, {The Graphics View Framework}
     268    \sa QGraphicsScene, QGraphicsView, {Graphics View Framework}
    268269*/
    269270
     
    382383    \value ItemSendsGeometryChanges The item enables itemChange()
    383384    notifications for ItemPositionChange, ItemPositionHasChanged,
    384     ItemMatrixChange, ItemTransformChange, and ItemTransformHasChanged. For
     385    ItemMatrixChange, ItemTransformChange, ItemTransformHasChanged,
     386    ItemRotationChange, ItemRotationHasChanged, ItemScaleChange, ItemScaleHasChanged,
     387    ItemTransformOriginPointChange, and ItemTransformOriginPointHasChanged. For
    385388    performance reasons, these notifications are disabled by default. You must
    386389    enable this flag to receive notifications for position and transform
     
    410413    to receive notifications for scene position changes. This flag was
    411414    introduced in Qt 4.6.
     415
     416    \omitvalue ItemStopsClickFocusPropagation \omit The item stops propagating
     417    click focus to items underneath when being clicked on. This flag
     418    allows you create a non-focusable item that can be clicked on without
     419    changing the focus. \endomit
    412420*/
    413421
     
    475483    (same as transform()), and QGraphicsItem ignores the return value for this
    476484    notification (i.e., a read-only notification).
     485
     486    \value ItemRotationChange The item's rotation property changes. This
     487    notification is sent if the ItemSendsGeometryChanges flag is enabled, and
     488    when the item's rotation property changes (i.e., as a result of calling
     489    setRotation()). The value argument is the new rotation (i.e., a double);
     490    to get the old rotation, call rotation(). Do not call setRotation() in
     491    itemChange() as this notification is delivered; instead, you can return
     492    the new rotation from itemChange().
     493
     494    \value ItemRotationHasChanged The item's rotation property has changed.
     495    This notification is sent if the ItemSendsGeometryChanges flag is enabled,
     496    and after the item's rotation property has changed. The value argument is
     497    the new rotation (i.e., a double), and QGraphicsItem ignores the return
     498    value for this notification (i.e., a read-only notification). Do not call
     499    setRotation() in itemChange() as this notification is delivered.
     500
     501    \value ItemScaleChange The item's scale property changes. This notification
     502    is sent if the ItemSendsGeometryChanges flag is enabled, and when the item's
     503    scale property changes (i.e., as a result of calling setScale()). The value
     504    argument is the new scale (i.e., a double); to get the old scale, call
     505    scale(). Do not call setScale() in itemChange() as this notification is
     506    delivered; instead, you can return the new scale from itemChange().
     507
     508    \value ItemScaleHasChanged The item's scale property has changed. This
     509    notification is sent if the ItemSendsGeometryChanges flag is enabled, and
     510    after the item's scale property has changed. The value argument is the new
     511    scale (i.e., a double), and QGraphicsItem ignores the return value for this
     512    notification (i.e., a read-only notification). Do not call setScale() in
     513    itemChange() as this notification is delivered.
     514
     515    \value ItemTransformOriginPointChange The item's transform origin point
     516    property changes. This notification is sent if the ItemSendsGeometryChanges
     517    flag is enabled, and when the item's transform origin point property changes
     518    (i.e., as a result of calling setTransformOriginPoint()). The value argument
     519    is the new origin point (i.e., a QPointF); to get the old origin point, call
     520    transformOriginPoint(). Do not call setTransformOriginPoint() in itemChange()
     521    as this notification is delivered; instead, you can return the new transform
     522    origin point from itemChange().
     523
     524    \value ItemTransformOriginPointHasChanged The item's transform origin point
     525    property has changed. This notification is sent if the ItemSendsGeometryChanges
     526    flag is enabled, and after the item's transform origin point property has
     527    changed. The value argument is the new origin point (i.e., a QPointF), and
     528    QGraphicsItem ignores the return value for this notification (i.e., a read-only
     529    notification). Do not call setTransformOriginPoint() in itemChange() as this
     530    notification is delivered.
    477531
    478532    \value ItemSelectedChange The item's selected state changes. If the item is
     
    674728#include <QtCore/qvariant.h>
    675729#include <QtCore/qvarlengtharray.h>
     730#include <QtCore/qnumeric.h>
    676731#include <QtGui/qapplication.h>
    677732#include <QtGui/qbitmap.h>
     
    683738#include <QtGui/qinputcontext.h>
    684739#include <QtGui/qgraphicseffect.h>
     740#ifndef QT_NO_ACCESSIBILITY
     741# include "qaccessible.h"
     742#endif
    685743
    686744#include <private/qgraphicsitem_p.h>
     
    690748#include <private/qtextengine_p.h>
    691749#include <private/qwidget_p.h>
     750#include <private/qapplication_p.h>
    692751
    693752#ifdef Q_WS_X11
     
    10381097        return;
    10391098
     1099    if (isWidget)
     1100        static_cast<QGraphicsWidgetPrivate *>(this)->fixFocusChainBeforeReparenting((newParent &&
     1101                                                        newParent->isWidget()) ? static_cast<QGraphicsWidget *>(newParent) : 0,
     1102                                                        scene);
    10401103    if (scene) {
    10411104        // Deliver the change to the index
     
    10881151                parentFocusScopeItem = fsi;
    10891152                p->d_ptr->focusScopeItem = 0;
     1153                fsi->d_ptr->focusScopeItemChange(false);
    10901154            }
    10911155            break;
     
    11201184            if (p->d_ptr->flags & QGraphicsItem::ItemIsFocusScope) {
    11211185                p->d_ptr->focusScopeItem = newFocusScopeItem;
     1186                newFocusScopeItem->d_ptr->focusScopeItemChange(true);
    11221187                // Ensure the new item is no longer the subFocusItem. The
    11231188                // only way to set focus on a child of a focus scope is
     
    11851250
    11861251    dirtySceneTransform = 1;
     1252    if (!inDestructor && (transformData || (newParent && newParent->d_ptr->transformData)))
     1253        transformChanged();
    11871254
    11881255    // Restore the sub focus chain.
     
    12061273    Returns the bounding rect of this item's children (excluding itself).
    12071274*/
    1208 void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rect)
    1209 {
     1275void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rect, QGraphicsItem *topMostEffectItem)
     1276{
     1277    Q_Q(QGraphicsItem);
     1278
     1279    QRectF childrenRect;
     1280    QRectF *result = rect;
     1281    rect = &childrenRect;
     1282    const bool setTopMostEffectItem = !topMostEffectItem;
     1283
    12101284    for (int i = 0; i < children.size(); ++i) {
    12111285        QGraphicsItem *child = children.at(i);
    12121286        QGraphicsItemPrivate *childd = child->d_ptr.data();
     1287        if (setTopMostEffectItem)
     1288            topMostEffectItem = child;
    12131289        bool hasPos = !childd->pos.isNull();
    12141290        if (hasPos || childd->transformData) {
     
    12171293            if (x)
    12181294                matrix *= *x;
    1219             *rect |= matrix.mapRect(child->boundingRect());
     1295            *rect |= matrix.mapRect(child->d_ptr->effectiveBoundingRect(topMostEffectItem));
    12201296            if (!childd->children.isEmpty())
    1221                 childd->childrenBoundingRectHelper(&matrix, rect);
     1297                childd->childrenBoundingRectHelper(&matrix, rect, topMostEffectItem);
    12221298        } else {
    12231299            if (x)
    1224                 *rect |= x->mapRect(child->boundingRect());
     1300                *rect |= x->mapRect(child->d_ptr->effectiveBoundingRect(topMostEffectItem));
    12251301            else
    1226                 *rect |= child->boundingRect();
     1302                *rect |= child->d_ptr->effectiveBoundingRect(topMostEffectItem);
    12271303            if (!childd->children.isEmpty())
    1228                 childd->childrenBoundingRectHelper(x, rect);
     1304                childd->childrenBoundingRectHelper(x, rect, topMostEffectItem);
    12291305        }
    12301306    }
     1307
     1308    if (flags & QGraphicsItem::ItemClipsChildrenToShape){
     1309        if (x)
     1310            *rect &= x->mapRect(q->boundingRect());
     1311        else
     1312            *rect &= q->boundingRect();
     1313    }
     1314
     1315    *result |= *rect;
    12311316}
    12321317
     
    13561441QGraphicsItem::~QGraphicsItem()
    13571442{
    1358     if (d_ptr->isObject)
    1359         QObjectPrivate::get(static_cast<QGraphicsObject *>(this))->wasDeleted = true;
     1443    if (d_ptr->isObject) {
     1444        QGraphicsObject *o = static_cast<QGraphicsObject *>(this);
     1445        QObjectPrivate *p = QObjectPrivate::get(o);
     1446        p->wasDeleted = true;
     1447        if (p->declarativeData) {
     1448            QAbstractDeclarativeData::destroyed(p->declarativeData, o);
     1449            p->declarativeData = 0;
     1450        }
     1451    }
     1452
    13601453    d_ptr->inDestructor = 1;
    13611454    d_ptr->removeExtraItemCache();
     1455
     1456#ifndef QT_NO_GESTURES
     1457    if (d_ptr->isObject && !d_ptr->gestureContext.isEmpty()) {
     1458        QGraphicsObject *o = static_cast<QGraphicsObject *>(this);
     1459        if (QGestureManager *manager = QGestureManager::instance()) {
     1460            foreach (Qt::GestureType type, d_ptr->gestureContext.keys())
     1461                manager->cleanupCachedGestures(o, type);
     1462        }
     1463    }
     1464#endif
    13621465
    13631466    clearFocus();
     
    17341837void QGraphicsItem::setFlags(GraphicsItemFlags flags)
    17351838{
    1736     if (isWindow())
    1737         flags |= ItemIsPanel;
    1738 
    17391839    // Notify change and check for adjustment.
    17401840    if (quint32(d_ptr->flags) == quint32(flags))
     
    17501850    bool fullUpdate = (quint32(flags) & geomChangeFlagsMask) != (d_ptr->flags & geomChangeFlagsMask);
    17511851    if (fullUpdate)
    1752         d_ptr->paintedViewBoundingRectsNeedRepaint = 1;
     1852        d_ptr->updatePaintedViewBoundingRects(/*children=*/true);
    17531853
    17541854    // Keep the old flags to compare the diff.
     
    17741874        // all children.
    17751875        d_ptr->updateAncestorFlag(ItemClipsChildrenToShape);
     1876        // The childrenBoundingRect is clipped to the boundingRect in case of ItemClipsChildrenToShape,
     1877        // which means we have to invalidate the cached childrenBoundingRect whenever this flag changes.
     1878        d_ptr->dirtyChildrenBoundingRect = 1;
     1879        d_ptr->markParentDirty(true);
    17761880    }
    17771881
     
    20222126    \snippet doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp 2
    20232127
    2024     If no cursor has been set, the parent's cursor is used.
     2128    If no cursor has been set, the cursor of the item beneath is used.
    20252129
    20262130    \sa setCursor(), hasCursor(), unsetCursor(), QWidget::cursor,
     
    22622366                            fsi = fsi->d_ptr->focusScopeItem;
    22632367                        fsi->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ true,
    2264                                                    /* focusFromShow = */ true);
     2368                                                   /* focusFromHide = */ false);
    22652369                    }
    22662370                    break;
     
    22722376                if (fi && fi != scene->focusItem()) {
    22732377                    scene->setFocusItem(fi);
     2378                } else if (flags & QGraphicsItem::ItemIsFocusScope &&
     2379                           !scene->focusItem() &&
     2380                           q->isAncestorOf(scene->d_func()->lastFocusItem)) {
     2381                    q_ptr->setFocus();
    22742382                }
    22752383            }
     
    22822390                        if (p->d_ptr->visible) {
    22832391                            p->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ true,
    2284                                                      /* focusFromShow = */ true);
     2392                                                     /* focusFromHide = */ true);
    22852393                        }
    22862394                        break;
     
    27042812    QGraphicsEffect *effect = graphicsEffect;
    27052813    if (scene && effect && effect->isEnabled()) {
     2814        if (scene->d_func()->views.isEmpty())
     2815            return effect->boundingRectFor(rect);
    27062816        QRectF sceneRect = q->mapRectToScene(rect);
    27072817        QRectF sceneEffectRect;
     
    27272837    \sa boundingRect()
    27282838*/
    2729 QRectF QGraphicsItemPrivate::effectiveBoundingRect() const
     2839QRectF QGraphicsItemPrivate::effectiveBoundingRect(QGraphicsItem *topMostEffectItem) const
    27302840{
    27312841#ifndef QT_NO_GRAPHICSEFFECT
    27322842    Q_Q(const QGraphicsItem);
    27332843    QRectF brect = effectiveBoundingRect(q_ptr->boundingRect());
    2734     if (ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren)
     2844    if (ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren || topMostEffectItem == q)
    27352845        return brect;
    27362846
     
    27432853            brect = effectParent->mapRectToItem(q, effectRectInParentSpace);
    27442854        }
    2745         if (effectParent->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren)
     2855        if (effectParent->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren
     2856            || topMostEffectItem == effectParent) {
    27462857            return brect;
     2858        }
    27472859        effectParent = effectParent->d_ptr->parent;
    27482860    }
     
    31383250void QGraphicsItem::setFocus(Qt::FocusReason focusReason)
    31393251{
    3140     d_ptr->setFocusHelper(focusReason, /* climb = */ true, /* focusFromShow = */ false);
     3252    d_ptr->setFocusHelper(focusReason, /* climb = */ true, /* focusFromHide = */ false);
    31413253}
    31423254
     
    31443256    \internal
    31453257*/
    3146 void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromShow)
     3258void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromHide)
    31473259{
    31483260    // Disabled / unfocusable items cannot accept focus.
     
    31633275    while (p) {
    31643276        if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
     3277            QGraphicsItem *oldFocusScopeItem = p->d_ptr->focusScopeItem;
    31653278            p->d_ptr->focusScopeItem = q_ptr;
    3166             if (!p->focusItem() && !focusFromShow) {
     3279            if (!p->focusItem() && !focusFromHide) {
     3280                if (oldFocusScopeItem)
     3281                    oldFocusScopeItem->d_ptr->focusScopeItemChange(false);
     3282                focusScopeItemChange(true);
    31673283                // If you call setFocus on a child of a focus scope that
    31683284                // doesn't currently have a focus item, then stop.
     
    31803296
    31813297    // Update the child focus chain.
    3182     f->d_ptr->setSubFocus();
     3298    QGraphicsItem *commonAncestor = 0;
     3299    if (scene && scene->focusItem()) {
     3300        commonAncestor = scene->focusItem()->commonAncestorItem(f);
     3301        scene->focusItem()->d_ptr->clearSubFocus(scene->focusItem(), commonAncestor);
     3302    }
     3303
     3304    f->d_ptr->setSubFocus(f, commonAncestor);
    31833305
    31843306    // Update the scene's focus item.
     
    32193341            while (p) {
    32203342                if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
    3221                     p->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ false,
    3222                                              /* focusFromShow = */ false);
     3343                    if (p->d_ptr->focusScopeItem == q_ptr) {
     3344                        p->d_ptr->focusScopeItem = 0;
     3345                        if (!q_ptr->hasFocus()) //if it has focus, focusScopeItemChange is called elsewhere
     3346                            focusScopeItemChange(false);
     3347                    }
     3348                    if (q_ptr->hasFocus())
     3349                        p->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ false,
     3350                                                 /* focusFromHide = */ false);
    32233351                    return;
    32243352                }
     
    32283356    }
    32293357
    3230     // Invisible items with focus must explicitly clear subfocus.
    3231     clearSubFocus(q_ptr);
    3232 
    32333358    if (q_ptr->hasFocus()) {
     3359        // Invisible items with focus must explicitly clear subfocus.
     3360        clearSubFocus(q_ptr);
     3361
    32343362        // If this item has the scene's input focus, clear it.
    32353363        scene->setFocusItem(0);
     
    34853613        return;
    34863614
    3487     d_ptr->setPosHelper(QPointF(x, d_ptr->pos.y()));
     3615    if (qIsNaN(x))
     3616        return;
     3617
     3618    setPos(QPointF(x, d_ptr->pos.y()));
    34883619}
    34893620
     
    35093640        return;
    35103641
    3511     d_ptr->setPosHelper(QPointF(d_ptr->pos.x(), y));
     3642    if (qIsNaN(y))
     3643        return;
     3644
     3645    setPos(QPointF(d_ptr->pos.x(), y));
    35123646}
    35133647
     
    35563690    transformData->transform = transform;
    35573691    dirtySceneTransform = 1;
     3692    transformChanged();
    35583693}
    35593694
     
    35773712
    35783713    // Update and repositition.
    3579     if (!(d_ptr->flags & ItemSendsGeometryChanges)) {
     3714    if (!(d_ptr->flags & (ItemSendsGeometryChanges | ItemSendsScenePositionChanges))) {
    35803715        d_ptr->setPosHelper(pos);
    35813716        if (d_ptr->isWidget)
    35823717            static_cast<QGraphicsWidget *>(this)->d_func()->setGeometryFromSetPos();
     3718        if (d_ptr->scenePosDescendants)
     3719            d_ptr->sendScenePosChange();
    35833720        return;
    35843721    }
     
    37243861{
    37253862    prepareGeometryChange();
     3863    qreal newRotation = angle;
     3864
     3865    if (d_ptr->flags & ItemSendsGeometryChanges) {
     3866        // Notify the item that the rotation is changing.
     3867        const QVariant newRotationVariant(itemChange(ItemRotationChange, angle));
     3868        newRotation = newRotationVariant.toReal();
     3869    }
     3870
    37263871    if (!d_ptr->transformData)
    37273872        d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
    3728     d_ptr->transformData->rotation = angle;
     3873
     3874    if (d_ptr->transformData->rotation == newRotation)
     3875        return;
     3876
     3877    d_ptr->transformData->rotation = newRotation;
    37293878    d_ptr->transformData->onlyTransform = false;
    37303879    d_ptr->dirtySceneTransform = 1;
    37313880
     3881    // Send post-notification.
     3882    if (d_ptr->flags & ItemSendsGeometryChanges)
     3883        itemChange(ItemRotationHasChanged, newRotation);
     3884
    37323885    if (d_ptr->isObject)
    37333886        emit static_cast<QGraphicsObject *>(this)->rotationChanged();
     3887
     3888    d_ptr->transformChanged();
    37343889}
    37353890
     
    37673922    transformations() to map the item's coordinate system to the parent item.
    37683923
    3769     \sa scale(), setTransformOriginPoint(), {Transformations}
     3924    \sa scale(), setTransformOriginPoint(), {Transformations Example}
    37703925*/
    37713926void QGraphicsItem::setScale(qreal factor)
    37723927{
    37733928    prepareGeometryChange();
     3929    qreal newScale = factor;
     3930
     3931    if (d_ptr->flags & ItemSendsGeometryChanges) {
     3932        // Notify the item that the scale is changing.
     3933        const QVariant newScaleVariant(itemChange(ItemScaleChange, factor));
     3934        newScale = newScaleVariant.toReal();
     3935    }
     3936
    37743937    if (!d_ptr->transformData)
    37753938        d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
    3776     d_ptr->transformData->scale = factor;
     3939
     3940    if (d_ptr->transformData->scale == newScale)
     3941        return;
     3942
     3943    d_ptr->transformData->scale = newScale;
    37773944    d_ptr->transformData->onlyTransform = false;
    37783945    d_ptr->dirtySceneTransform = 1;
    37793946
     3947    // Send post-notification.
     3948    if (d_ptr->flags & ItemSendsGeometryChanges)
     3949        itemChange(ItemScaleHasChanged, newScale);
     3950
    37803951    if (d_ptr->isObject)
    37813952        emit static_cast<QGraphicsObject *>(this)->scaleChanged();
     3953
     3954    d_ptr->transformChanged();
    37823955}
    37833956
     
    37893962
    37903963    QGraphicsTransform is for applying and controlling a chain of individual
    3791     transformation operations on an item. It's particularily useful in
     3964    transformation operations on an item. It's particularly useful in
    37923965    animations, where each transform operation needs to be interpolated
    37933966    independently, or differently.
     
    38163989
    38173990    QGraphicsTransform is for applying and controlling a chain of individual
    3818     transformation operations on an item. It's particularily useful in
     3991    transformation operations on an item. It's particularly useful in
    38193992    animations, where each transform operation needs to be interpolated
    38203993    independently, or differently.
     
    38354008    d_ptr->transformData->onlyTransform = false;
    38364009    d_ptr->dirtySceneTransform = 1;
     4010    d_ptr->transformChanged();
     4011}
     4012
     4013/*!
     4014    \internal
     4015*/
     4016void QGraphicsItemPrivate::prependGraphicsTransform(QGraphicsTransform *t)
     4017{
     4018    if (!transformData)
     4019        transformData = new QGraphicsItemPrivate::TransformData;
     4020    if (!transformData->graphicsTransforms.contains(t))
     4021        transformData->graphicsTransforms.prepend(t);
     4022
     4023    Q_Q(QGraphicsItem);
     4024    t->d_func()->setItem(q);
     4025    transformData->onlyTransform = false;
     4026    dirtySceneTransform = 1;
     4027    transformChanged();
    38374028}
    38384029
     
    38514042    transformData->onlyTransform = false;
    38524043    dirtySceneTransform = 1;
     4044    transformChanged();
    38534045}
    38544046
     
    38794071{
    38804072    prepareGeometryChange();
     4073    QPointF newOrigin = origin;
     4074
     4075    if (d_ptr->flags & ItemSendsGeometryChanges) {
     4076        // Notify the item that the origin point is changing.
     4077        const QVariant newOriginVariant(itemChange(ItemTransformOriginPointChange,
     4078                                                   qVariantFromValue<QPointF>(origin)));
     4079        newOrigin = newOriginVariant.toPointF();
     4080    }
     4081
    38814082    if (!d_ptr->transformData)
    38824083        d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
    3883     d_ptr->transformData->xOrigin = origin.x();
    3884     d_ptr->transformData->yOrigin = origin.y();
     4084
     4085    if (d_ptr->transformData->xOrigin == newOrigin.x()
     4086        && d_ptr->transformData->yOrigin == newOrigin.y()) {
     4087        return;
     4088    }
     4089
     4090    d_ptr->transformData->xOrigin = newOrigin.x();
     4091    d_ptr->transformData->yOrigin = newOrigin.y();
    38854092    d_ptr->transformData->onlyTransform = false;
    38864093    d_ptr->dirtySceneTransform = 1;
     4094
     4095    // Send post-notification.
     4096    if (d_ptr->flags & ItemSendsGeometryChanges)
     4097        itemChange(ItemTransformOriginPointHasChanged, qVariantFromValue<QPointF>(newOrigin));
    38874098}
    38884099
     
    41894400
    41904401    // Update and set the new transformation.
    4191     if (!(d_ptr->flags & ItemSendsGeometryChanges)) {
     4402    if (!(d_ptr->flags & (ItemSendsGeometryChanges | ItemSendsScenePositionChanges))) {
    41924403        d_ptr->setTransformHelper(newTransform);
     4404        if (d_ptr->scenePosDescendants)
     4405            d_ptr->sendScenePosChange();
    41934406        return;
    41944407    }
     
    45314744
    45324745    d_ptr->childrenBoundingRect = QRectF();
    4533     d_ptr->childrenBoundingRectHelper(0, &d_ptr->childrenBoundingRect);
     4746    d_ptr->childrenBoundingRectHelper(0, &d_ptr->childrenBoundingRect, 0);
    45344747    d_ptr->dirtyChildrenBoundingRect = 0;
    45354748    return d_ptr->childrenBoundingRect;
     
    49725185    contents. Although it's expensive to calculate, it's also more precise
    49735186    than boundingRect(), and it can help to avoid unnecessary repainting when
    4974     an item is updated. This is particularily efficient for thin items (e.g.,
     5187    an item is updated. This is particularly efficient for thin items (e.g.,
    49755188    lines or simple polygons). You can tune the granularity for the bounding
    49765189    region by calling setBoundingRegionGranularity(). The default granularity
     
    52285441    child->d_ptr->siblingIndex = children.size();
    52295442    children.append(child);
     5443    if (isObject)
     5444        emit static_cast<QGraphicsObject *>(q_ptr)->childrenChanged();
    52305445}
    52315446
     
    52505465    // (see ensureSortedChildren()).
    52515466    child->d_ptr->siblingIndex = -1;
     5467    if (isObject)
     5468        emit static_cast<QGraphicsObject *>(q_ptr)->childrenChanged();
    52525469}
    52535470
     
    52855502    }
    52865503    unsetExtra(ExtraCacheData);
     5504}
     5505
     5506void QGraphicsItemPrivate::updatePaintedViewBoundingRects(bool updateChildren)
     5507{
     5508    if (!scene)
     5509        return;
     5510
     5511    for (int i = 0; i < scene->d_func()->views.size(); ++i) {
     5512        QGraphicsViewPrivate *viewPrivate = scene->d_func()->views.at(i)->d_func();
     5513        QRect rect = paintedViewBoundingRects.value(viewPrivate->viewport);
     5514        rect.translate(viewPrivate->dirtyScrollOffset);
     5515        viewPrivate->updateRect(rect);
     5516    }
     5517
     5518    if (updateChildren) {
     5519        for (int i = 0; i < children.size(); ++i)
     5520            children.at(i)->d_ptr->updatePaintedViewBoundingRects(true);
     5521    }
    52875522}
    52885523
     
    53245559    \internal
    53255560*/
    5326 void QGraphicsItemPrivate::setSubFocus(QGraphicsItem *rootItem)
     5561void QGraphicsItemPrivate::setSubFocus(QGraphicsItem *rootItem, QGraphicsItem *stopItem)
    53275562{
    53285563    // Update focus child chain. Stop at panels, or if this item
    53295564    // is hidden, stop at the first item with a visible parent.
    53305565    QGraphicsItem *parent = rootItem ? rootItem : q_ptr;
     5566    if (parent->panel() != q_ptr->panel())
     5567        return;
     5568
    53315569    do {
    53325570        // Clear any existing ancestor's subFocusItem.
     
    53345572            if (parent->d_ptr->subFocusItem == q_ptr)
    53355573                break;
    5336             parent->d_ptr->subFocusItem->d_ptr->clearSubFocus();
     5574            parent->d_ptr->subFocusItem->d_ptr->clearSubFocus(0, stopItem);
    53375575        }
    53385576        parent->d_ptr->subFocusItem = q_ptr;
     
    53475585    \internal
    53485586*/
    5349 void QGraphicsItemPrivate::clearSubFocus(QGraphicsItem *rootItem)
     5587void QGraphicsItemPrivate::clearSubFocus(QGraphicsItem *rootItem, QGraphicsItem *stopItem)
    53505588{
    53515589    // Reset sub focus chain.
     
    53555593            break;
    53565594        parent->d_ptr->subFocusItem = 0;
    5357         parent->d_ptr->subFocusItemChange();
     5595        if (parent != stopItem && !parent->isAncestorOf(stopItem))
     5596            parent->d_ptr->subFocusItemChange();
    53585597    } while (!parent->isPanel() && (parent = parent->d_ptr->parent));
    53595598}
     
    53805619void QGraphicsItemPrivate::subFocusItemChange()
    53815620{
     5621}
     5622
     5623/*!
     5624    \internal
     5625
     5626    Subclasses can reimplement this function to be notified when an item
     5627    becomes a focusScopeItem (or is no longer a focusScopeItem).
     5628*/
     5629void QGraphicsItemPrivate::focusScopeItemChange(bool isSubFocusItem)
     5630{
     5631    Q_UNUSED(isSubFocusItem);
    53825632}
    53835633
     
    54465696    }
    54475697
    5448     if (d_ptr->discardUpdateRequest())
    5449         return;
    5450 
    54515698    if (d_ptr->scene)
    54525699        d_ptr->scene->d_func()->markDirty(this, rect);
     
    54705717    is equivalent to calling update(\a rect).
    54715718
     5719    \bold{Note:} Scrolling is only supported when QGraphicsItem::ItemCoordinateCache
     5720    is enabled; in all other cases calling this function is equivalent to calling
     5721    update(\a rect). If you for sure know that the item is opaque and not overlapped
     5722    by other items, you can map the \a rect to viewport coordinates and scroll the
     5723    viewport.
     5724
     5725    \snippet doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp 19
     5726
    54725727    \sa boundingRect()
    54735728*/
     
    54795734    if (!d->scene)
    54805735        return;
    5481     if (d->cacheMode != NoCache) {
    5482         QGraphicsItemCache *c;
    5483         bool scrollCache = qFuzzyIsNull(dx - int(dx)) && qFuzzyIsNull(dy - int(dy))
    5484                            && (c = (QGraphicsItemCache *)qVariantValue<void *>(d_ptr->extra(QGraphicsItemPrivate::ExtraCacheData)))
    5485                            && (d->cacheMode == ItemCoordinateCache && !c->fixedSize.isValid());
    5486         if (scrollCache) {
    5487             QPixmap pix;
    5488             if (QPixmapCache::find(c->key, &pix)) {
    5489                 // Adjust with 2 pixel margin. Notice the loss of precision
    5490                 // when converting to QRect.
    5491                 int adjust = 2;
    5492                 QRectF br = boundingRect().adjusted(-adjust, -adjust, adjust, adjust);
    5493                 QRect irect = rect.toRect().translated(-br.x(), -br.y());
    5494 
    5495                 pix.scroll(dx, dy, irect);
    5496 
    5497                 QPixmapCache::replace(c->key, pix);
    5498 
    5499                 // Translate the existing expose.
    5500                 foreach (QRectF exposedRect, c->exposed)
    5501                     c->exposed += exposedRect.translated(dx, dy) & rect;
    5502 
    5503                 // Calculate exposure.
    5504                 QRegion exposed;
    5505                 QRect r = rect.toRect();
    5506                 exposed += r;
    5507                 exposed -= r.translated(dx, dy);
    5508                 foreach (QRect rect, exposed.rects())
    5509                     update(rect);
    5510                 d->scene->d_func()->markDirty(this);
    5511             } else {
    5512                 update(rect);
    5513             }
    5514         } else {
    5515             // ### This is very slow, and can be done much better. If the cache is
    5516             // local and matches the below criteria for rotation and scaling, we
    5517             // can easily scroll. And if the cache is in device coordinates, we
    5518             // can scroll both the viewport and the cache.
    5519             update(rect);
    5520         }
     5736
     5737    // Accelerated scrolling means moving pixels from one location to another
     5738    // and only redraw the newly exposed area. The following requirements must
     5739    // be fulfilled in order to do that:
     5740    //
     5741    // 1) Item is opaque.
     5742    // 2) Item is not overlapped by other items.
     5743    //
     5744    // There's (yet) no way to detect whether an item is opaque or not, which means
     5745    // we cannot do accelerated scrolling unless the cache is enabled. In case of using
     5746    // DeviceCoordinate cache we also have to take the device transform into account in
     5747    // order to determine whether we can do accelerated scrolling or not. That's left out
     5748    // for simplicity here, but it is definitely something we can consider in the future
     5749    // as a performance improvement.
     5750    if (d->cacheMode != QGraphicsItem::ItemCoordinateCache
     5751        || !qFuzzyIsNull(dx - int(dx)) || !qFuzzyIsNull(dy - int(dy))) {
     5752        update(rect);
    55215753        return;
    55225754    }
    55235755
    5524     QRectF scrollRect = !rect.isNull() ? rect : boundingRect();
    5525     int couldntScroll = d->scene->views().size();
    5526     foreach (QGraphicsView *view, d->scene->views()) {
    5527         if (view->viewport()->inherits("QGLWidget")) {
    5528             // ### Please replace with a widget attribute; any widget that
    5529             // doesn't support partial updates / doesn't support scrolling
    5530             // should be skipped in this code. Qt::WA_NoPartialUpdates or so.
     5756    QGraphicsItemCache *cache = d->extraItemCache();
     5757    if (cache->allExposed || cache->fixedSize.isValid()) {
     5758        // Cache is either invalidated or item is scaled (see QGraphicsItem::setCacheMode).
     5759        update(rect);
     5760        return;
     5761    }
     5762
     5763    // Find pixmap in cache.
     5764    QPixmap cachedPixmap;
     5765    if (!QPixmapCache::find(cache->key, &cachedPixmap)) {
     5766        update(rect);
     5767        return;
     5768    }
     5769
     5770    QRect scrollRect = (rect.isNull() ? boundingRect() : rect).toAlignedRect();
     5771    if (!scrollRect.intersects(cache->boundingRect))
     5772        return; // Nothing to scroll.
     5773
     5774    // Remove from cache to avoid deep copy when modifying.
     5775    QPixmapCache::remove(cache->key);
     5776
     5777    QRegion exposed;
     5778    cachedPixmap.scroll(dx, dy, scrollRect.translated(-cache->boundingRect.topLeft()), &exposed);
     5779
     5780    // Reinsert into cache.
     5781    cache->key = QPixmapCache::insert(cachedPixmap);
     5782
     5783    // Translate the existing expose.
     5784    for (int i = 0; i < cache->exposed.size(); ++i) {
     5785        QRectF &e = cache->exposed[i];
     5786        if (!rect.isNull() && !e.intersects(rect))
    55315787            continue;
    5532         }
    5533 
    5534         static const QLineF up(0, 0, 0, -1);
    5535         static const QLineF down(0, 0, 0, 1);
    5536         static const QLineF left(0, 0, -1, 0);
    5537         static const QLineF right(0, 0, 1, 0);
    5538 
    5539         QTransform deviceTr = deviceTransform(view->viewportTransform());
    5540         QRect deviceScrollRect = deviceTr.mapRect(scrollRect).toRect();
    5541         QLineF v1 = deviceTr.map(right);
    5542         QLineF v2 = deviceTr.map(down);
    5543         QLineF u1 = v1.unitVector(); u1.translate(-v1.p1());
    5544         QLineF u2 = v2.unitVector(); u2.translate(-v2.p1());
    5545         bool noScroll = false;
    5546 
    5547         // Check if the delta resolves to ints in device space.
    5548         QPointF deviceDelta = deviceTr.map(QPointF(dx, dy));
    5549         if ((deviceDelta.x() - int(deviceDelta.x()))
    5550             || (deviceDelta.y() - int(deviceDelta.y()))) {
    5551             noScroll = true;
    5552         } else {
    5553             // Check if the unit vectors have no fraction in device space.
    5554             qreal v1l = v1.length();
    5555             if (v1l - int(v1l)) {
    5556                 noScroll = true;
    5557             } else {
    5558                 dx *= v1.length();
    5559             }
    5560             qreal v2l = v2.length();
    5561             if (v2l - int(v2l)) {
    5562                 noScroll = true;
    5563             } else {
    5564                 dy *= v2.length();
    5565             }
    5566         }
    5567 
    5568         if (!noScroll) {
    5569             if (u1 == right) {
    5570                 if (u2 == up) {
    5571                     // flipped
    5572                     dy = -dy;
    5573                 } else if (u2 == down) {
    5574                     // normal
    5575                 } else {
    5576                     noScroll = true;
    5577                 }
    5578             } else if (u1 == left) {
    5579                 if (u2 == up) {
    5580                     // mirrored & flipped / rotated 180 degrees
    5581                     dx = -dx;
    5582                     dy = -dy;
    5583                 } else if (u2 == down) {
    5584                     // mirrored
    5585                     dx = -dx;
    5586                 } else {
    5587                     noScroll = true;
    5588                 }
    5589             } else if (u1 == up) {
    5590                 if (u2 == left) {
    5591                     // rotated -90 & mirrored
    5592                     qreal tmp = dy;
    5593                     dy = -dx;
    5594                     dx = -tmp;
    5595                 } else if (u2 == right) {
    5596                     // rotated -90
    5597                     qreal tmp = dy;
    5598                     dy = -dx;
    5599                     dx = tmp;
    5600                 } else {
    5601                     noScroll = true;
    5602                 }
    5603             } else if (u1 == down) {
    5604                 if (u2 == left) {
    5605                     // rotated 90
    5606                     qreal tmp = dy;
    5607                     dy = dx;
    5608                     dx = -tmp;
    5609                 } else if (u2 == right) {
    5610                     // rotated 90 & mirrored
    5611                     qreal tmp = dy;
    5612                     dy = dx;
    5613                     dx = tmp;
    5614                 } else {
    5615                     noScroll = true;
    5616                 }
    5617             }
    5618         }
    5619 
    5620         if (!noScroll) {
    5621             view->viewport()->scroll(int(dx), int(dy), deviceScrollRect);
    5622             --couldntScroll;
    5623         }
    5624     }
    5625     if (couldntScroll)
    5626         update(rect);
     5788        e.translate(dx, dy);
     5789    }
     5790
     5791    // Append newly exposed areas. Note that the exposed region is currently
     5792    // in pixmap coordinates, so we have to translate it to item coordinates.
     5793    exposed.translate(cache->boundingRect.topLeft());
     5794    const QVector<QRect> exposedRects = exposed.rects();
     5795    for (int i = 0; i < exposedRects.size(); ++i)
     5796        cache->exposed += exposedRects.at(i);
     5797
     5798    // Trigger update. This will redraw the newly exposed area and make sure
     5799    // the pixmap is re-blitted in case there are overlapping items.
     5800    d->scene->d_func()->markDirty(this, rect);
    56275801}
    56285802
     
    65006674    }
    65016675
     6676    if (event->type() == QEvent::FocusOut) {
     6677        focusOutEvent(static_cast<QFocusEvent *>(event));
     6678        return true;
     6679    }
     6680
    65026681    if (!d_ptr->visible) {
    65036682        // Eaten
     
    65086687    case QEvent::FocusIn:
    65096688        focusInEvent(static_cast<QFocusEvent *>(event));
    6510         break;
    6511     case QEvent::FocusOut:
    6512         focusOutEvent(static_cast<QFocusEvent *>(event));
    65136689        break;
    65146690    case QEvent::GraphicsSceneContextMenu:
     
    69857161                    // calculate their diff by mapping viewport coordinates
    69867162                    // directly to parent coordinates.
    6987                     QTransform viewToParentTransform = (item->transform().translate(item->d_ptr->pos.x(), item->d_ptr->pos.y()))
     7163                    // COMBINE
     7164                    QTransform itemTransform;
     7165                    if (item->d_ptr->transformData)
     7166                        itemTransform = item->d_ptr->transformData->computedFullTransform();
     7167                    itemTransform.translate(item->d_ptr->pos.x(), item->d_ptr->pos.y());
     7168                    QTransform viewToParentTransform = itemTransform
    69887169                                                       * (item->sceneTransform() * view->viewportTransform()).inverted();
    69897170                    currentParentPos = viewToParentTransform.map(QPointF(view->mapFromGlobal(event->screenPos())));
     
    71797360    Q_D(QGraphicsItem);
    71807361    d->imHints = hints;
     7362    if (!hasFocus())
     7363        return;
     7364    d->scene->d_func()->updateInputMethodSensitivityInViews();
     7365#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
     7366    QWidget *fw = QApplication::focusWidget();
     7367    if (!fw)
     7368        return;
     7369    for (int i = 0 ; i < scene()->views().count() ; ++i)
     7370        if (scene()->views().at(i) == fw)
     7371            if (QInputContext *inputContext = fw->inputContext())
     7372                inputContext->update();
     7373#endif
     7374}
     7375
     7376/*!
     7377    Updates the item's micro focus.
     7378
     7379    \since 4.7
     7380
     7381    \sa QInputContext
     7382*/
     7383void QGraphicsItem::updateMicroFocus()
     7384{
     7385#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
     7386    if (QWidget *fw = QApplication::focusWidget()) {
     7387        if (scene()) {
     7388            for (int i = 0 ; i < scene()->views().count() ; ++i) {
     7389                if (scene()->views().at(i) == fw)
     7390                    if (QInputContext *inputContext = fw->inputContext())
     7391                        inputContext->update();
     7392            }
     7393        }
     7394#ifndef QT_NO_ACCESSIBILITY
     7395        // ##### is this correct
     7396        QAccessible::updateAccessibility(fw, 0, QAccessible::StateChanged);
     7397#endif
     7398    }
     7399#endif
    71817400}
    71827401
     
    74317650}
    74327651
     7652#ifndef QT_NO_GESTURES
    74337653/*!
    74347654    Subscribes the graphics object to the given \a gesture with specific \a flags.
     
    74387658void QGraphicsObject::grabGesture(Qt::GestureType gesture, Qt::GestureFlags flags)
    74397659{
    7440     QGraphicsItemPrivate * const d = QGraphicsItem::d_func();
    7441     d->gestureContext.insert(gesture, flags);
    7442     (void)QGestureManager::instance(); // create a gesture manager
     7660    bool contains = QGraphicsItem::d_ptr->gestureContext.contains(gesture);
     7661    QGraphicsItem::d_ptr->gestureContext.insert(gesture, flags);
     7662    if (!contains && QGraphicsItem::d_ptr->scene)
     7663        QGraphicsItem::d_ptr->scene->d_func()->grabGesture(this, gesture);
    74437664}
    74447665
     
    74507671void QGraphicsObject::ungrabGesture(Qt::GestureType gesture)
    74517672{
    7452     QGraphicsItemPrivate * const d = QGraphicsItem::d_func();
    7453     if (d->gestureContext.remove(gesture)) {
    7454         QGestureManager *manager = QGestureManager::instance();
    7455         manager->cleanupCachedGestures(this, gesture);
    7456     }
    7457 }
     7673    if (QGraphicsItem::d_ptr->gestureContext.remove(gesture) && QGraphicsItem::d_ptr->scene)
     7674        QGraphicsItem::d_ptr->scene->d_func()->ungrabGesture(this, gesture);
     7675}
     7676#endif // QT_NO_GESTURES
     7677
     7678/*!
     7679    Updates the item's micro focus. This is slot for convenience.
     7680
     7681    \since 4.7
     7682
     7683    \sa QInputContext
     7684*/
     7685void QGraphicsObject::updateMicroFocus()
     7686{
     7687    QGraphicsItem::updateMicroFocus();
     7688}
     7689
     7690void QGraphicsItemPrivate::children_append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item)
     7691{
     7692    QGraphicsObject *graphicsObject = static_cast<QGraphicsObject *>(list->object);
     7693    if (QGraphicsItemPrivate::get(graphicsObject)->sendParentChangeNotification) {
     7694        item->setParentItem(graphicsObject);
     7695    } else {
     7696        QGraphicsItemPrivate::get(item)->setParentItemHelper(graphicsObject, 0, 0);
     7697    }
     7698}
     7699
     7700int QGraphicsItemPrivate::children_count(QDeclarativeListProperty<QGraphicsObject> *list)
     7701{
     7702    QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object));
     7703    return d->children.count();
     7704}
     7705
     7706QGraphicsObject *QGraphicsItemPrivate::children_at(QDeclarativeListProperty<QGraphicsObject> *list, int index)
     7707{
     7708    QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object));
     7709    if (index >= 0 && index < d->children.count())
     7710        return d->children.at(index)->toGraphicsObject();
     7711    else
     7712        return 0;
     7713}
     7714
     7715void QGraphicsItemPrivate::children_clear(QDeclarativeListProperty<QGraphicsObject> *list)
     7716{
     7717    QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object));
     7718    int childCount = d->children.count();
     7719    if (d->sendParentChangeNotification) {
     7720        for (int index = 0; index < childCount; index++)
     7721            d->children.at(0)->setParentItem(0);
     7722    } else {
     7723        for (int index = 0; index < childCount; index++)
     7724            QGraphicsItemPrivate::get(d->children.at(0))->setParentItemHelper(0, 0, 0);
     7725    }
     7726}
     7727
     7728/*!
     7729    Returns a list of this item's children.
     7730
     7731    The items are sorted by stacking order. This takes into account both the
     7732    items' insertion order and their Z-values.
     7733
     7734*/
     7735QDeclarativeListProperty<QGraphicsObject> QGraphicsItemPrivate::childrenList()
     7736{
     7737    Q_Q(QGraphicsItem);
     7738    if (isObject) {
     7739        QGraphicsObject *that = static_cast<QGraphicsObject *>(q);
     7740        return QDeclarativeListProperty<QGraphicsObject>(that, &children, children_append,
     7741                                                         children_count, children_at, children_clear);
     7742    } else {
     7743        //QGraphicsItem is not supported for this property
     7744        return QDeclarativeListProperty<QGraphicsObject>();
     7745    }
     7746}
     7747
     7748/*!
     7749  \internal
     7750  Returns the width of the item
     7751  Reimplemented by QGraphicsWidget
     7752*/
     7753qreal QGraphicsItemPrivate::width() const
     7754{
     7755    return 0;
     7756}
     7757
     7758/*!
     7759  \internal
     7760  Set the width of the item
     7761  Reimplemented by QGraphicsWidget
     7762*/
     7763void QGraphicsItemPrivate::setWidth(qreal w)
     7764{
     7765    Q_UNUSED(w);
     7766}
     7767
     7768/*!
     7769  \internal
     7770  Reset the width of the item
     7771  Reimplemented by QGraphicsWidget
     7772*/
     7773void QGraphicsItemPrivate::resetWidth()
     7774{
     7775}
     7776
     7777/*!
     7778  \internal
     7779  Returns the height of the item
     7780  Reimplemented by QGraphicsWidget
     7781*/
     7782qreal QGraphicsItemPrivate::height() const
     7783{
     7784    return 0;
     7785}
     7786
     7787/*!
     7788  \internal
     7789  Set the height of the item
     7790  Reimplemented by QGraphicsWidget
     7791*/
     7792void QGraphicsItemPrivate::setHeight(qreal h)
     7793{
     7794    Q_UNUSED(h);
     7795}
     7796
     7797/*!
     7798  \internal
     7799  Reset the height of the item
     7800  Reimplemented by QGraphicsWidget
     7801*/
     7802void QGraphicsItemPrivate::resetHeight()
     7803{
     7804}
     7805
     7806/*!
     7807    \property QGraphicsObject::children
     7808    \since 4.7
     7809    \internal
     7810*/
     7811
     7812/*!
     7813    \property QGraphicsObject::width
     7814    \since 4.7
     7815    \internal
     7816*/
     7817
     7818/*!
     7819    \property QGraphicsObject::height
     7820    \since 4.7
     7821    \internal
     7822*/
    74587823
    74597824/*!
     
    76438008*/
    76448009
     8010/*!
     8011    \fn void QGraphicsObject::widthChanged()
     8012    \internal
     8013*/
     8014
     8015/*!
     8016    \fn void QGraphicsObject::heightChanged()
     8017    \internal
     8018*/
     8019
     8020/*!
     8021
     8022  \fn QGraphicsObject::childrenChanged()
     8023
     8024  This signal gets emitted whenever the children list changes
     8025  \internal
     8026*/
     8027
     8028/*!
     8029  \property QGraphicsObject::effect
     8030  \since 4.7
     8031  \brief the effect attached to this item
     8032
     8033  \sa QGraphicsItem::setGraphicsEffect(), QGraphicsItem::graphicsEffect()
     8034*/
    76458035
    76468036/*!
     
    76608050    \sa QGraphicsRectItem, QGraphicsEllipseItem, QGraphicsPathItem,
    76618051    QGraphicsPolygonItem, QGraphicsTextItem, QGraphicsLineItem,
    7662     QGraphicsPixmapItem, {The Graphics View Framework}
     8052    QGraphicsPixmapItem, {Graphics View Framework}
    76638053*/
    76648054
     
    77998189
    78008190    \sa QGraphicsRectItem, QGraphicsEllipseItem, QGraphicsPolygonItem,
    7801     QGraphicsTextItem, QGraphicsLineItem, QGraphicsPixmapItem, {The Graphics
     8191    QGraphicsTextItem, QGraphicsLineItem, QGraphicsPixmapItem, {Graphics
    78028192    View Framework}
    78038193*/
     
    80088398
    80098399    \sa QGraphicsPathItem, QGraphicsEllipseItem, QGraphicsPolygonItem,
    8010     QGraphicsTextItem, QGraphicsLineItem, QGraphicsPixmapItem, {The Graphics
     8400    QGraphicsTextItem, QGraphicsLineItem, QGraphicsPixmapItem, {Graphics
    80118401    View Framework}
    80128402*/
     
    82528642
    82538643    \sa QGraphicsPathItem, QGraphicsRectItem, QGraphicsPolygonItem,
    8254     QGraphicsTextItem, QGraphicsLineItem, QGraphicsPixmapItem, {The Graphics
     8644    QGraphicsTextItem, QGraphicsLineItem, QGraphicsPixmapItem, {Graphics
    82558645    View Framework}
    82568646*/
     
    85618951
    85628952    \sa QGraphicsPathItem, QGraphicsRectItem, QGraphicsEllipseItem,
    8563     QGraphicsTextItem, QGraphicsLineItem, QGraphicsPixmapItem, {The Graphics
     8953    QGraphicsTextItem, QGraphicsLineItem, QGraphicsPixmapItem, {Graphics
    85648954    View Framework}
    85658955*/
     
    87939183
    87949184    \sa QGraphicsPathItem, QGraphicsRectItem, QGraphicsEllipseItem,
    8795     QGraphicsTextItem, QGraphicsPolygonItem, QGraphicsPixmapItem, {The
    8796     Graphics View Framework}
     9185    QGraphicsTextItem, QGraphicsPolygonItem, QGraphicsPixmapItem,
     9186    {Graphics View Framework}
    87979187*/
    87989188
     
    90639453
    90649454    \sa QGraphicsPathItem, QGraphicsRectItem, QGraphicsEllipseItem,
    9065     QGraphicsTextItem, QGraphicsPolygonItem, QGraphicsLineItem, {The
    9066     Graphics View Framework}
     9455    QGraphicsTextItem, QGraphicsPolygonItem, QGraphicsLineItem,
     9456    {Graphics View Framework}
    90679457*/
    90689458
     
    94349824    \sa QGraphicsSimpleTextItem, QGraphicsPathItem, QGraphicsRectItem,
    94359825        QGraphicsEllipseItem, QGraphicsPixmapItem, QGraphicsPolygonItem,
    9436         QGraphicsLineItem, {The Graphics View Framework}
     9826        QGraphicsLineItem, {Graphics View Framework}
    94379827*/
    94389828
     
    980510195        }
    980610196        break;
     10197    case QEvent::ShortcutOverride:
     10198        dd->sendControlEvent(event);
     10199        return true;
    980710200    default:
    980810201        break;
     
    1034710740    \img graphicsview-simpletextitem.png
    1034810741
    10349     \sa QGraphicsTextItem, QGraphicsPathItem, QGraphicsRectItem, QGraphicsEllipseItem,
    10350     QGraphicsPixmapItem, QGraphicsPolygonItem, QGraphicsLineItem, {The
    10351     Graphics View Framework}
     10742    \sa QGraphicsTextItem, QGraphicsPathItem, QGraphicsRectItem,
     10743    QGraphicsEllipseItem, QGraphicsPixmapItem, QGraphicsPolygonItem,
     10744    QGraphicsLineItem, {Graphics View Framework}
    1035210745*/
    1035310746
     
    1055710950/*!
    1055810951    \class QGraphicsItemGroup
    10559     \brief The QGraphicsItemGroup class provides treating a group of items as
    10560     one.
     10952    \brief The QGraphicsItemGroup class provides a container that treats
     10953    a group of items as a single item.
    1056110954    \since 4.2
    1056210955    \ingroup graphicsview-api
     
    1061011003    position and transformation remain intact.
    1061111004
    10612     \sa QGraphicsItem, {The Graphics View Framework}
     11005    \sa QGraphicsItem, {Graphics View Framework}
    1061311006*/
    1061411007
     
    1093111324    } else if (deviceCoordinates) {
    1093211325        // Device coordinates with info.
    10933         scened->draw(item, &pixmapPainter, info->viewTransform, info->transformPtr, info->exposedRegion,
     11326        scened->draw(item, &pixmapPainter, info->viewTransform, info->transformPtr, 0,
    1093411327                     info->widget, info->opacity, &effectTransform, info->wasDirtySceneTransform,
    1093511328                     info->drawItem);
     
    1093811331        QTransform newEffectTransform = info->transformPtr->inverted();
    1093911332        newEffectTransform *= effectTransform;
    10940         scened->draw(item, &pixmapPainter, info->viewTransform, info->transformPtr, info->exposedRegion,
     11333        scened->draw(item, &pixmapPainter, info->viewTransform, info->transformPtr, 0,
    1094111334                     info->widget, info->opacity, &newEffectTransform, info->wasDirtySceneTransform,
    1094211335                     info->drawItem);
     
    1107411467        str = "ItemScenePositionHasChanged";
    1107511468        break;
     11469    case QGraphicsItem::ItemRotationChange:
     11470        str = "ItemRotationChange";
     11471        break;
     11472    case QGraphicsItem::ItemRotationHasChanged:
     11473        str = "ItemRotationHasChanged";
     11474        break;
     11475    case QGraphicsItem::ItemScaleChange:
     11476        str = "ItemScaleChange";
     11477        break;
     11478    case QGraphicsItem::ItemScaleHasChanged:
     11479        str = "ItemScaleHasChanged";
     11480        break;
     11481    case QGraphicsItem::ItemTransformOriginPointChange:
     11482        str = "ItemTransformOriginPointChange";
     11483        break;
     11484    case QGraphicsItem::ItemTransformOriginPointHasChanged:
     11485        str = "ItemTransformOriginPointHasChanged";
     11486        break;
    1107611487    }
    1107711488    debug << str;
     
    1113411545        str = "ItemSendsScenePositionChanges";
    1113511546        break;
     11547    case QGraphicsItem::ItemStopsClickFocusPropagation:
     11548        str = "ItemStopsClickFocusPropagation";
     11549        break;
    1113611550    }
    1113711551    debug << str;
     
    1114311557    debug << '(';
    1114411558    bool f = false;
    11145     for (int i = 0; i < 16; ++i) {
     11559    for (int i = 0; i < 17; ++i) {
    1114611560        if (flags & (1 << i)) {
    1114711561            if (f)
Note: See TracChangeset for help on using the changeset viewer.