From eaab8d4ac2635dc785d98e33322ddc8af8fb7fce Mon Sep 17 00:00:00 2001 From: Ye ShanShan Date: Thu, 5 Dec 2024 17:31:34 +0800 Subject: [PATCH] fix: app crashed when QBytearray reallocated Using a variable to avoid reallocating memory. pms: BUG-292371 --- xcb/dhighdpi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xcb/dhighdpi.cpp b/xcb/dhighdpi.cpp index 5e4df97b..3b899325 100644 --- a/xcb/dhighdpi.cpp +++ b/xcb/dhighdpi.cpp @@ -104,7 +104,8 @@ QDpi DHighDpi::logicalDpi(QXcbScreen *s) } int dpi = 0; - QVariant value = DPlatformIntegration::xSettings(s->connection())->setting("Qt/DPI/" + s->name().toLocal8Bit()); + const QString screenName(QString("Qt/DPI/%1").arg(s->name())); + QVariant value = DPlatformIntegration::xSettings(s->connection())->setting(screenName.toLocal8Bit()); bool ok = false; dpi = value.toInt(&ok);