From 27350cf51e3ea9a29e475f0bbb7a245220447c68 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 29 Apr 2020 20:23:00 +0200 Subject: Fix high CPU usage on high dpi screens Fixes #180 --- src/RoomInfoListItem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/RoomInfoListItem.cpp') diff --git a/src/RoomInfoListItem.cpp b/src/RoomInfoListItem.cpp index 11818649..13c7b54d 100644 --- a/src/RoomInfoListItem.cpp +++ b/src/RoomInfoListItem.cpp @@ -151,7 +151,8 @@ RoomInfoListItem::paintEvent(QPaintEvent *event) auto wm = getMetrics(QFont{}); - QPixmap pixmap(avatar_->size()); + QPixmap pixmap(avatar_->size() * p.device()->devicePixelRatioF()); + pixmap.setDevicePixelRatio(p.device()->devicePixelRatioF()); if (isPressed_) { p.fillRect(rect(), highlightedBackgroundColor_); titlePen.setColor(highlightedTitleColor_); -- cgit 1.5.1