Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

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

    r651 r769  
    694694    if (!selectionChanging && selectedItems.size() != oldSelectedItemsSize)
    695695        emit q->selectionChanged();
     696
     697    QHash<QGesture *, QGraphicsObject *>::iterator it;
     698    for (it = gestureTargets.begin(); it != gestureTargets.end();) {
     699        if (it.value() == item)
     700            it = gestureTargets.erase(it);
     701        else
     702            ++it;
     703    }
    696704}
    697705
     
    802810            if (item) {
    803811                for (int i = 0; i < views.size(); ++i)
    804                     views.at(i)->inputContext()->reset();
     812                    if (views.at(i)->inputContext())
     813                        views.at(i)->inputContext()->reset();
    805814            }
    806815        }
     
    808817    }
    809818
     819    if (item)
     820        focusItem = item;
     821    updateInputMethodSensitivityInViews();
    810822    if (item) {
    811         focusItem = item;
    812823        QFocusEvent event(QEvent::FocusIn, focusReason);
    813824        sendEvent(item, &event);
    814825    }
    815 
    816     updateInputMethodSensitivityInViews();
    817826}
    818827
     
    37723781    for (int i = 0; i < itemsAtPos.size(); ++i) {
    37733782        QGraphicsItem *tmp = itemsAtPos.at(i);
     3783        if (tmp->d_func()->isProxyWidget()) {
     3784            // if the item is a proxy widget, the event is forwarded to it
     3785            sendEvent(tmp, helpEvent);
     3786            if (helpEvent->isAccepted())
     3787                return;
     3788        }
    37743789        if (!tmp->toolTip().isEmpty()) {
    37753790            toolTipItem = tmp;
     
    42854300        // Blit the subpixmap into the main pixmap.
    42864301        pixmapPainter.begin(pix);
     4302        pixmapPainter.setCompositionMode(QPainter::CompositionMode_Source);
    42874303        pixmapPainter.setClipRegion(pixmapExposed);
    42884304        pixmapPainter.drawPixmap(br.topLeft(), subPix);
     
    44504466
    44514467        // Create or reuse offscreen pixmap, possibly scroll/blit from the old one.
     4468        // If the world transform is rotated we always recreate the cache to avoid
     4469        // wrong blending.
    44524470        bool pixModified = false;
    44534471        QGraphicsItemCache::DeviceData *deviceData = &itemCache->deviceData[widget];
     
    44574475            diff *= painter->worldTransform();
    44584476        deviceData->lastTransform = painter->worldTransform();
    4459         if (!invertable || diff.type() > QTransform::TxTranslate) {
     4477        if (!invertable
     4478            || diff.type() > QTransform::TxTranslate
     4479            || painter->worldTransform().type() > QTransform::TxScale) {
    44604480            pixModified = true;
    44614481            itemCache->allExposed = true;
     
    46794699            item->d_ptr->paintedViewBoundingRects.insert(widget, viewBoundingRect);
    46804700        viewBoundingRect.adjust(-1, -1, 1, 1);
    4681         drawItem = exposedRegion ? exposedRegion->intersects(viewBoundingRect) : !viewBoundingRect.isEmpty();
     4701        drawItem = exposedRegion ? exposedRegion->intersects(viewBoundingRect)
     4702                                 : !viewBoundingRect.normalized().isEmpty();
    46824703        if (!drawItem) {
    46834704            if (!itemHasChildren)
     
    47134734            && sourced->lastEffectTransform != painter->worldTransform())
    47144735        {
    4715             bool unclipped = false;
    47164736            if (sourced->lastEffectTransform.type() <= QTransform::TxTranslate
    47174737                && painter->worldTransform().type() <= QTransform::TxTranslate)
    47184738            {
    4719                 QRectF itemRect = item->boundingRect();
    4720                 if (!item->d_ptr->children.isEmpty())
    4721                     itemRect |= item->childrenBoundingRect();
    4722 
    4723                 QRectF oldSourceRect = sourced->lastEffectTransform.mapRect(itemRect);
    4724                 QRectF newSourceRect = painter->worldTransform().mapRect(itemRect);
    4725 
    4726                 QRect oldEffectRect = sourced->paddedEffectRect(sourced->currentCachedSystem(), sourced->currentCachedMode(), oldSourceRect);
    4727                 QRect newEffectRect = sourced->paddedEffectRect(sourced->currentCachedSystem(), sourced->currentCachedMode(), newSourceRect);
    4728 
    4729                 QRect deviceRect(0, 0, painter->device()->width(), painter->device()->height());
    4730                 if (deviceRect.contains(oldEffectRect) && deviceRect.contains(newEffectRect)) {
    4731                     sourced->setCachedOffset(newEffectRect.topLeft());
    4732                     unclipped = true;
    4733                 }
     4739                QRectF sourceRect = sourced->boundingRect(Qt::DeviceCoordinates);
     4740                QRect effectRect = sourced->paddedEffectRect(Qt::DeviceCoordinates, sourced->currentCachedMode(), sourceRect);
     4741
     4742                sourced->setCachedOffset(effectRect.topLeft());
     4743            } else {
     4744                sourced->invalidateCache(QGraphicsEffectSourcePrivate::TransformChanged);
    47344745            }
    47354746
    47364747            sourced->lastEffectTransform = painter->worldTransform();
    4737 
    4738             if (!unclipped)
    4739                 sourced->invalidateCache(QGraphicsEffectSourcePrivate::TransformChanged);
    47404748        }
    47414749
     
    48494857
    48504858void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, bool invalidateChildren,
    4851                                       bool force, bool ignoreOpacity, bool removingItemFromScene)
     4859                                      bool force, bool ignoreOpacity, bool removingItemFromScene,
     4860                                      bool updateBoundingRect)
    48524861{
    48534862    Q_ASSERT(item);
     
    49204929        item->d_ptr->ignoreOpacity = 1;
    49214930
    4922     item->d_ptr->markParentDirty();
     4931    if (!updateBoundingRect)
     4932        item->d_ptr->markParentDirty();
    49234933}
    49244934
     
    51315141
    51325142/*!
     5143    \obsolete
     5144
    51335145    Paints the given \a items using the provided \a painter, after the
    51345146    background has been drawn, and before the foreground has been
     
    51535165    \snippet doc/src/snippets/graphicssceneadditemsnippet.cpp 0
    51545166
    5155     \obsolete Since Qt 4.6, this function is not called anymore unless
     5167    Since Qt 4.6, this function is not called anymore unless
    51565168    the QGraphicsView::IndirectPainting flag is given as an Optimization
    51575169    flag.
     
    57095721            bool res = sendTouchBeginEvent(item, &touchEvent)
    57105722                       && touchEvent.isAccepted();
    5711             if (!res)
     5723            if (!res) {
     5724                // forget about these touch points, we didn't handle them
     5725                for (int i = 0; i < touchEvent.touchPoints().count(); ++i) {
     5726                    const QTouchEvent::TouchPoint &touchPoint = touchEvent.touchPoints().at(i);
     5727                    itemForTouchPointId.remove(touchPoint.id());
     5728                    sceneCurrentTouchPoints.remove(touchPoint.id());
     5729                }
    57125730                ignoreSceneTouchEvent = false;
     5731            }
    57135732            break;
    57145733        }
     
    59015920            QList<QGraphicsObject *> result;
    59025921            for (int j = 0; j < items.size(); ++j) {
    5903                 QGraphicsObject *item = items.at(j)->toGraphicsObject();
    5904                 if (!item)
    5905                     continue;
    5906                 QGraphicsItemPrivate *d = item->QGraphicsItem::d_func();
    5907                 if (d->gestureContext.contains(gestureType)) {
    5908                     result.append(item);
     5922                QGraphicsItem *item = items.at(j);
     5923
     5924                // Check if the item is blocked by a modal panel and use it as
     5925                // a target instead of this item.
     5926                (void) item->isBlockedByModalPanel(&item);
     5927
     5928                if (QGraphicsObject *itemobj = item->toGraphicsObject()) {
     5929                    QGraphicsItemPrivate *d = item->d_func();
     5930                    if (d->gestureContext.contains(gestureType)) {
     5931                        result.append(itemobj);
     5932                    }
    59095933                }
     5934                // Don't propagate through panels.
     5935                if (item->isPanel())
     5936                    break;
    59105937            }
    59115938            DEBUG() << "QGraphicsScenePrivate::getGestureTargets:"
Note: See TracChangeset for help on using the changeset viewer.