From d1bdae94a7c5dfb1867ada9031e229fb08332244 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 27 Sep 2018 22:11:00 +0100 Subject: [PATCH] Add workaround for QTBUG-52697, manually do high-dpi in rich text --- qrenderdoc/Code/QRDUtils.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qrenderdoc/Code/QRDUtils.cpp b/qrenderdoc/Code/QRDUtils.cpp index 28b9af27b..7b370cd4a 100644 --- a/qrenderdoc/Code/QRDUtils.cpp +++ b/qrenderdoc/Code/QRDUtils.cpp @@ -48,6 +48,7 @@ #include #include #include +#include "Code/Resources.h" #include "Widgets/Extended/RDTreeWidget.h" // normally this is in the renderdoc core library, but it's needed for the 'unknown enum' path, @@ -107,6 +108,8 @@ struct RichResourceText int i = 0; + bool highdpi = widget->devicePixelRatioF() > 1.0; + QVector fragmentIndexFromBlockIndex; // there's an empty block at the start. @@ -119,7 +122,9 @@ struct RichResourceText if(v.userType() == qMetaTypeId()) { QString resname = QString(ctx.GetResourceName(v.value())).toHtmlEscaped(); - html += lit("%1").arg(resname); + html += lit("%1") + .arg(resname) + .arg(highdpi ? lit("@2x") : QString()); text += resname; // these generate two blocks (one for each cell)