summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorTim Blechmann <tim.blechmann@qt.io>2025-10-09 09:47:21 +0800
committerTim Blechmann <tim.blechmann@qt.io>2025-10-09 21:00:50 +0800
commitad19d87b7c27bf3f355f3806704367d45b817f28 (patch)
tree04f7881f5fbd2cb95eb457087ad46cdadab98f06 /src/widgets/kernel/qwidget.cpp
parentfe65df06c346086cccc658b0a42300766ffed12d (diff)
QWidget: initPainter - remove unnecessary const_cast
const_cast tend to be evil and is not necessary when calling a function that takes a const pointer. Pick-to: 6.10 Change-Id: I0e10a5717c636e474a21cb710f1f9d213adeb6b7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r--src/widgets/kernel/qwidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 0d3c6be10cc..54c7206b6c7 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -13140,7 +13140,7 @@ void QWidget::initPainter(QPainter *painter) const
const QPalette &pal = palette();
painter->d_func()->state->pen = QPen(pal.brush(foregroundRole()), 1);
painter->d_func()->state->bgBrush = pal.brush(backgroundRole());
- QFont f(font(), const_cast<QWidget *>(this));
+ QFont f(font(), this);
painter->d_func()->state->deviceFont = f;
painter->d_func()->state->font = f;
}