diff options
Diffstat (limited to 'examples/widgets/graphicsview/padnavigator')
-rw-r--r-- | examples/widgets/graphicsview/padnavigator/roundrectitem.cpp | 6 | ||||
-rw-r--r-- | examples/widgets/graphicsview/padnavigator/splashitem.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/widgets/graphicsview/padnavigator/roundrectitem.cpp b/examples/widgets/graphicsview/padnavigator/roundrectitem.cpp index f629400a76..82205050ec 100644 --- a/examples/widgets/graphicsview/padnavigator/roundrectitem.cpp +++ b/examples/widgets/graphicsview/padnavigator/roundrectitem.cpp @@ -62,7 +62,7 @@ RoundRectItem::RoundRectItem(const QRectF &bounds, const QColor &color, gradient.setStart(bounds.topLeft()); gradient.setFinalStop(bounds.bottomRight()); gradient.setColorAt(0, color); - gradient.setColorAt(1, color.dark(200)); + gradient.setColorAt(1, color.darker(200)); setCacheMode(ItemCoordinateCache); } //! [0] @@ -94,7 +94,7 @@ void RoundRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt Q_UNUSED(widget); painter->setPen(Qt::NoPen); painter->setBrush(QColor(0, 0, 0, 64)); - painter->drawRoundRect(bounds.translated(2, 2)); + painter->drawRoundedRect(bounds.translated(2, 2), 25, 25, Qt::RelativeSize); //! [3] //! [4] if (fillRect) @@ -102,7 +102,7 @@ void RoundRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt else painter->setBrush(gradient); painter->setPen(QPen(Qt::black, 1)); - painter->drawRoundRect(bounds); + painter->drawRoundedRect(bounds, 25,25, Qt::RelativeSize); //! [4] //! [5] if (!pix.isNull()) { diff --git a/examples/widgets/graphicsview/padnavigator/splashitem.cpp b/examples/widgets/graphicsview/padnavigator/splashitem.cpp index 0c3a05dd9a..7c3dfba588 100644 --- a/examples/widgets/graphicsview/padnavigator/splashitem.cpp +++ b/examples/widgets/graphicsview/padnavigator/splashitem.cpp @@ -79,7 +79,7 @@ void SplashItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option painter->setPen(QPen(Qt::black, 2)); painter->setBrush(QColor(245, 245, 255, 220)); painter->setClipRect(boundingRect()); - painter->drawRoundRect(3, -100 + 3, 400 - 6, 250 - 6); + painter->drawRoundedRect(3, -100 + 3, 400 - 6, 250 - 6, 25, 25, Qt::RelativeSize); QRectF textRect = boundingRect().adjusted(10, 10, -10, -10); int flags = Qt::AlignTop | Qt::AlignLeft | Qt::TextWordWrap; |