Changeset 769 for trunk/src/gui/graphicsview/qgraphicsview.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/qgraphicsview.cpp
r651 r769 3361 3361 if (viewTransformed) 3362 3362 backgroundPainter.setTransform(viewTransform); 3363 #ifdef Q_WS_X113364 #undef X113365 if (backgroundPainter.paintEngine()->type() != QPaintEngine::X11)3366 #define X11 qt_x11Data3367 #endif3368 backgroundPainter.setCompositionMode(QPainter::CompositionMode_Source);3369 3363 QRectF backgroundExposedSceneRect = mapToScene(d->backgroundPixmapExposed.boundingRect()).boundingRect(); 3370 3364 drawBackground(&backgroundPainter, backgroundExposedSceneRect); … … 3401 3395 painter.setWorldTransform(viewTransform); 3402 3396 } else { 3397 // Make sure we don't have unpolished items before we draw 3398 if (!d->scene->d_func()->unpolishedItems.isEmpty()) 3399 d->scene->d_func()->_q_polishItems(); 3400 // We reset updateAll here (after we've issued polish events) 3401 // so that we can discard update requests coming from polishEvent(). 3402 d->scene->d_func()->updateAll = false; 3403 3403 3404 // Find all exposed items 3404 3405 bool allItems = false; … … 3409 3410 QGraphicsItem **itemArray = &itemList[0]; // Relies on QList internals, but is perfectly valid. 3410 3411 QStyleOptionGraphicsItem *styleOptionArray = d->allocStyleOptionsArray(numItems); 3412 QTransform transform(Qt::Uninitialized); 3411 3413 for (int i = 0; i < numItems; ++i) { 3412 itemArray[i]->d_ptr->initStyleOption(&styleOptionArray[i], viewTransform, 3413 d->exposedRegion, allItems); 3414 QGraphicsItem *item = itemArray[i]; 3415 QGraphicsItemPrivate *itemd = item->d_ptr.data(); 3416 itemd->initStyleOption(&styleOptionArray[i], viewTransform, d->exposedRegion, allItems); 3417 // Cache the item's area in view coordinates. 3418 // Note that we have to do this here in case the base class implementation 3419 // (QGraphicsScene::drawItems) is not called. If it is, we'll do this 3420 // operation twice, but that's the price one has to pay for using indirect 3421 // painting :-/. 3422 const QRectF brect = adjustedItemEffectiveBoundingRect(item); 3423 if (!itemd->itemIsUntransformable()) { 3424 transform = item->sceneTransform(); 3425 if (viewTransformed) 3426 transform *= viewTransform; 3427 } else { 3428 transform = item->deviceTransform(viewTransform); 3429 } 3430 itemd->paintedViewBoundingRects.insert(d->viewport, transform.mapRect(brect).toRect()); 3414 3431 } 3415 3432 // Draw the items. … … 3610 3627 3611 3628 /*! 3629 \obsolete 3630 3612 3631 Draws the items \a items in the scene using \a painter, after the 3613 3632 background and before the foreground are drawn. \a numItems is the number … … 3618 3637 The default implementation calls the scene's drawItems() function. 3619 3638 3620 \obsoleteSince Qt 4.6, this function is not called anymore unless3639 Since Qt 4.6, this function is not called anymore unless 3621 3640 the QGraphicsView::IndirectPainting flag is given as an Optimization 3622 3641 flag.
Note:
See TracChangeset
for help on using the changeset viewer.