summaryrefslogtreecommitdiffstats
path: root/examples/widgets/graphicsview/padnavigator/roundrectitem.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2019-04-16 16:32:08 +0200
committerTobias Hunger <tobias.hunger@qt.io>2019-04-16 16:32:08 +0200
commit6630937e63ae5797487b86743a7733c8ae5cc42c (patch)
tree3d53dacf6430f9099e1fb20835881205de674961 /examples/widgets/graphicsview/padnavigator/roundrectitem.cpp
parent37ed6dae00640f9cc980ffda05347c12a7eb5d7e (diff)
parentc7af193d2e49e9f10b86262e63d8d13abf72b5cf (diff)
Merge commit 'dev' into 'wip/cmake-merge'
Diffstat (limited to 'examples/widgets/graphicsview/padnavigator/roundrectitem.cpp')
-rw-r--r--examples/widgets/graphicsview/padnavigator/roundrectitem.cpp6
1 files changed, 3 insertions, 3 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()) {