diff --git a/AuthDialog.cpp b/AuthDialog.cpp --- a/AuthDialog.cpp +++ b/AuthDialog.cpp @@ -105,30 +105,34 @@ m_message = message; } + const qreal dpr = devicePixelRatioF(); + // loads the standard key icon QPixmap icon = KIconLoader::global()->loadIcon("dialog-password", KIconLoader::NoGroup, - KIconLoader::SizeHuge, + KIconLoader::SizeHuge * dpr, KIconLoader::DefaultState); + icon.setDevicePixelRatio(dpr); // create a painter to paint the action icon over the key icon QPainter painter(&icon); const int iconSize = icon.size().width(); // the emblem icon to size 32 int overlaySize = 32; // try to load the action icon - const QPixmap pixmap = KIconLoader::global()->loadIcon(iconName, + QPixmap pixmap = KIconLoader::global()->loadIcon(iconName, KIconLoader::NoGroup, - overlaySize, + overlaySize * dpr, KIconLoader::DefaultState, QStringList(), nullptr, true); + pixmap.setDevicePixelRatio(dpr); // if we're able to load the action icon paint it over the // key icon. if (!pixmap.isNull()) { - QPoint startPoint; + QPointF startPoint; // bottom right corner - startPoint = QPoint(iconSize - overlaySize - 2, + startPoint = QPointF(iconSize - overlaySize - 2, iconSize - overlaySize - 2); painter.drawPixmap(startPoint, pixmap); }