From 014d41d933c716b5eadb72d20c13e77e96d83c7f Mon Sep 17 00:00:00 2001 From: zhangjiarui Date: Thu, 28 May 2026 20:43:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20setNewResolutionLis?= =?UTF-8?q?t=20=E6=8E=92=E5=BA=8F=E4=B8=8D=E4=B8=80=E8=87=B4=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=88=86=E8=BE=A8=E7=8E=87=E7=B4=A2=E5=BC=95=E9=94=99?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setNewResolutionList 排序条件使用了 <=,相同宽度时无条件交换, 导致排序结果与 settingDialog 不一致。摄像头重连后保存的索引值 在重新打开设置界面时映射到了错误的分辨率(如 640x480 显示为 640x360)。 Log: 修复 setNewResolutionList 排序不一致导致分辨率索引错位 Bug: https://pms.uniontech.com/bug-view-363077.html --- src/src/Settings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/src/Settings.cpp b/src/src/Settings.cpp index afd28586..4009d21a 100644 --- a/src/src/Settings.cpp +++ b/src/src/Settings.cpp @@ -136,8 +136,8 @@ void Settings::setNewResolutionList() QStringList resolutiontemp1 = resolutionDatabase[j].split("x"); QStringList resolutiontemp2 = resolutionDatabase[j + 1].split("x"); - if ((resolutiontemp1[0].toInt() <= resolutiontemp2[0].toInt()) - || (resolutiontemp1[1].toInt() < resolutiontemp2[1].toInt())) { + if ((resolutiontemp1[0].toInt() < resolutiontemp2[0].toInt()) || + (resolutiontemp1[0].toInt() == resolutiontemp2[0].toInt() && (resolutiontemp1[1].toInt() < resolutiontemp2[1].toInt()))) { QString resolutionstr = resolutionDatabase[j + 1]; resolutionDatabase[j + 1] = resolutionDatabase[j]; resolutionDatabase[j] = resolutionstr;