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/qgraphicsview.cpp

    r651 r769  
    33613361            if (viewTransformed)
    33623362                backgroundPainter.setTransform(viewTransform);
    3363 #ifdef Q_WS_X11
    3364 #undef X11
    3365             if (backgroundPainter.paintEngine()->type() != QPaintEngine::X11)
    3366 #define X11 qt_x11Data
    3367 #endif
    3368                 backgroundPainter.setCompositionMode(QPainter::CompositionMode_Source);
    33693363            QRectF backgroundExposedSceneRect = mapToScene(d->backgroundPixmapExposed.boundingRect()).boundingRect();
    33703364            drawBackground(&backgroundPainter, backgroundExposedSceneRect);
     
    34013395            painter.setWorldTransform(viewTransform);
    34023396    } 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
    34033404        // Find all exposed items
    34043405        bool allItems = false;
     
    34093410            QGraphicsItem **itemArray = &itemList[0]; // Relies on QList internals, but is perfectly valid.
    34103411            QStyleOptionGraphicsItem *styleOptionArray = d->allocStyleOptionsArray(numItems);
     3412            QTransform transform(Qt::Uninitialized);
    34113413            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());
    34143431            }
    34153432            // Draw the items.
     
    36103627
    36113628/*!
     3629    \obsolete
     3630
    36123631    Draws the items \a items in the scene using \a painter, after the
    36133632    background and before the foreground are drawn. \a numItems is the number
     
    36183637    The default implementation calls the scene's drawItems() function.
    36193638
    3620     \obsolete Since Qt 4.6, this function is not called anymore unless
     3639    Since Qt 4.6, this function is not called anymore unless
    36213640    the QGraphicsView::IndirectPainting flag is given as an Optimization
    36223641    flag.
Note: See TracChangeset for help on using the changeset viewer.