summaryrefslogtreecommitdiffstats
path: root/examples/widgets/widgets
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-12-10 13:51:40 +0200
committerLiang Qi <liang.qi@qt.io>2019-12-10 13:51:40 +0200
commit90210d5d9c4029057035019f144212922494ff0a (patch)
tree1aacefa57786964d47a200791280ae91c9b825da /examples/widgets/widgets
parentc69a2448ab129d88411a4778f2350dcf971dc623 (diff)
parent5231c26a82a7056f98d99643850754d4e1ebe417 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts: tests/auto/network/kernel/qnetworkinterface/BLACKLIST Change-Id: I1e8866c63b54bcd95fc2a044276ee15b7f60e79a
Diffstat (limited to 'examples/widgets/widgets')
-rw-r--r--examples/widgets/widgets/shapedclock/shapedclock.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/widgets/widgets/shapedclock/shapedclock.cpp b/examples/widgets/widgets/shapedclock/shapedclock.cpp
index 3c78f4da89..673d1a218f 100644
--- a/examples/widgets/widgets/shapedclock/shapedclock.cpp
+++ b/examples/widgets/widgets/shapedclock/shapedclock.cpp
@@ -61,6 +61,7 @@
ShapedClock::ShapedClock(QWidget *parent)
: QWidget(parent, Qt::FramelessWindowHint | Qt::WindowSystemMenuHint)
{
+ setAttribute(Qt::WA_TranslucentBackground);
QTimer *timer = new QTimer(this);
connect(timer, &QTimer::timeout, this, QOverload<>::of(&ShapedClock::update));
timer->start(1000);
@@ -123,6 +124,10 @@ void ShapedClock::paintEvent(QPaintEvent *)
painter.scale(side / 200.0, side / 200.0);
painter.setPen(Qt::NoPen);
+ painter.setBrush(palette().window());
+ painter.drawEllipse(QPoint(0, 0), 98, 98);
+
+ painter.setPen(Qt::NoPen);
painter.setBrush(hourColor);
painter.save();
@@ -168,6 +173,6 @@ void ShapedClock::resizeEvent(QResizeEvent * /* event */)
//! [5]
QSize ShapedClock::sizeHint() const
{
- return QSize(100, 100);
+ return QSize(200, 200);
}
//! [5]