diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-05-12 10:38:22 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-05-12 10:38:22 (GMT) |
commit | cc957f4cb1a8dce2fb1eb406f54ccecb4092d238 (patch) | |
tree | 5463704092728f10a58931fba7a2a74fa71f73d0 /src/gui/widgets/qprintpreviewwidget.cpp | |
parent | f14620878beed97c85c4b6a03a38f485800328d1 (diff) | |
parent | 8c0cdfdd4772e81164d838b9549e8c554ecf5966 (diff) | |
download | Qt-cc957f4cb1a8dce2fb1eb406f54ccecb4092d238.zip Qt-cc957f4cb1a8dce2fb1eb406f54ccecb4092d238.tar.gz Qt-cc957f4cb1a8dce2fb1eb406f54ccecb4092d238.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/gui/widgets/qprintpreviewwidget.cpp')
-rw-r--r-- | src/gui/widgets/qprintpreviewwidget.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/gui/widgets/qprintpreviewwidget.cpp b/src/gui/widgets/qprintpreviewwidget.cpp index 16334b8..d4e5122 100644 --- a/src/gui/widgets/qprintpreviewwidget.cpp +++ b/src/gui/widgets/qprintpreviewwidget.cpp @@ -98,29 +98,8 @@ void PageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QRectF paperRect(0,0, paperSize.width(), paperSize.height()); - painter->setClipRect(paperRect & option->exposedRect); - painter->fillRect(paperRect, Qt::white); - if (!pagePicture) - return; - painter->drawPicture(pageRect.topLeft(), *pagePicture); - - // Effect: make anything drawn in the margins look washed out. - QPainterPath path; - path.addRect(paperRect); - path.addRect(pageRect); - painter->setPen(QPen(Qt::NoPen)); - painter->setBrush(QColor(255, 255, 255, 180)); - painter->drawPath(path); - - painter->setClipRect(option->exposedRect); -#if 0 - // Draw frame around paper. - painter->setPen(QPen(Qt::black, 0)); - painter->setBrush(Qt::NoBrush); - painter->drawRect(paperRect); -#endif - // Draw shadow + painter->setClipRect(option->exposedRect); qreal shWidth = paperRect.width()/100; QRectF rshadow(paperRect.topRight() + QPointF(0, shWidth), paperRect.bottomRight() + QPointF(shWidth, 0)); @@ -141,6 +120,27 @@ void PageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, cgrad.setColorAt(1.0, QColor(0,0,0,0)); painter->fillRect(cshadow, QBrush(cgrad)); + painter->setClipRect(paperRect & option->exposedRect); + painter->fillRect(paperRect, Qt::white); + if (!pagePicture) + return; + painter->drawPicture(pageRect.topLeft(), *pagePicture); + + // Effect: make anything drawn in the margins look washed out. + QPainterPath path; + path.addRect(paperRect); + path.addRect(pageRect); + painter->setPen(QPen(Qt::NoPen)); + painter->setBrush(QColor(255, 255, 255, 180)); + painter->drawPath(path); + +#if 0 + // Draw frame around paper. + painter->setPen(QPen(Qt::black, 0)); + painter->setBrush(Qt::NoBrush); + painter->drawRect(paperRect); +#endif + // todo: drawtext "Page N" below paper } |