Changeset 769 for trunk/src/gui/graphicsview/qgraphicsscene.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/graphicsview/qgraphicsscene.cpp
r651 r769 694 694 if (!selectionChanging && selectedItems.size() != oldSelectedItemsSize) 695 695 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 } 696 704 } 697 705 … … 802 810 if (item) { 803 811 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(); 805 814 } 806 815 } … … 808 817 } 809 818 819 if (item) 820 focusItem = item; 821 updateInputMethodSensitivityInViews(); 810 822 if (item) { 811 focusItem = item;812 823 QFocusEvent event(QEvent::FocusIn, focusReason); 813 824 sendEvent(item, &event); 814 825 } 815 816 updateInputMethodSensitivityInViews();817 826 } 818 827 … … 3772 3781 for (int i = 0; i < itemsAtPos.size(); ++i) { 3773 3782 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 } 3774 3789 if (!tmp->toolTip().isEmpty()) { 3775 3790 toolTipItem = tmp; … … 4285 4300 // Blit the subpixmap into the main pixmap. 4286 4301 pixmapPainter.begin(pix); 4302 pixmapPainter.setCompositionMode(QPainter::CompositionMode_Source); 4287 4303 pixmapPainter.setClipRegion(pixmapExposed); 4288 4304 pixmapPainter.drawPixmap(br.topLeft(), subPix); … … 4450 4466 4451 4467 // 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. 4452 4470 bool pixModified = false; 4453 4471 QGraphicsItemCache::DeviceData *deviceData = &itemCache->deviceData[widget]; … … 4457 4475 diff *= painter->worldTransform(); 4458 4476 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) { 4460 4480 pixModified = true; 4461 4481 itemCache->allExposed = true; … … 4679 4699 item->d_ptr->paintedViewBoundingRects.insert(widget, viewBoundingRect); 4680 4700 viewBoundingRect.adjust(-1, -1, 1, 1); 4681 drawItem = exposedRegion ? exposedRegion->intersects(viewBoundingRect) : !viewBoundingRect.isEmpty(); 4701 drawItem = exposedRegion ? exposedRegion->intersects(viewBoundingRect) 4702 : !viewBoundingRect.normalized().isEmpty(); 4682 4703 if (!drawItem) { 4683 4704 if (!itemHasChildren) … … 4713 4734 && sourced->lastEffectTransform != painter->worldTransform()) 4714 4735 { 4715 bool unclipped = false;4716 4736 if (sourced->lastEffectTransform.type() <= QTransform::TxTranslate 4717 4737 && painter->worldTransform().type() <= QTransform::TxTranslate) 4718 4738 { 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); 4734 4745 } 4735 4746 4736 4747 sourced->lastEffectTransform = painter->worldTransform(); 4737 4738 if (!unclipped)4739 sourced->invalidateCache(QGraphicsEffectSourcePrivate::TransformChanged);4740 4748 } 4741 4749 … … 4849 4857 4850 4858 void 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) 4852 4861 { 4853 4862 Q_ASSERT(item); … … 4920 4929 item->d_ptr->ignoreOpacity = 1; 4921 4930 4922 item->d_ptr->markParentDirty(); 4931 if (!updateBoundingRect) 4932 item->d_ptr->markParentDirty(); 4923 4933 } 4924 4934 … … 5131 5141 5132 5142 /*! 5143 \obsolete 5144 5133 5145 Paints the given \a items using the provided \a painter, after the 5134 5146 background has been drawn, and before the foreground has been … … 5153 5165 \snippet doc/src/snippets/graphicssceneadditemsnippet.cpp 0 5154 5166 5155 \obsoleteSince Qt 4.6, this function is not called anymore unless5167 Since Qt 4.6, this function is not called anymore unless 5156 5168 the QGraphicsView::IndirectPainting flag is given as an Optimization 5157 5169 flag. … … 5709 5721 bool res = sendTouchBeginEvent(item, &touchEvent) 5710 5722 && 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 } 5712 5730 ignoreSceneTouchEvent = false; 5731 } 5713 5732 break; 5714 5733 } … … 5901 5920 QList<QGraphicsObject *> result; 5902 5921 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 } 5909 5933 } 5934 // Don't propagate through panels. 5935 if (item->isPanel()) 5936 break; 5910 5937 } 5911 5938 DEBUG() << "QGraphicsScenePrivate::getGestureTargets:"
Note:
See TracChangeset
for help on using the changeset viewer.