From 1c2033a3374950162cc4b328e39a81f2fec7603b Mon Sep 17 00:00:00 2001 From: DuanRay Date: Mon, 9 Oct 2023 19:07:54 +0800 Subject: [PATCH] fix: auto scaling when use DPI screen --- 0003-auto-scaling-and-fix-error.patch | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 0003-auto-scaling-and-fix-error.patch diff --git a/0003-auto-scaling-and-fix-error.patch b/0003-auto-scaling-and-fix-error.patch new file mode 100644 index 0000000..fe7fdbf --- /dev/null +++ b/0003-auto-scaling-and-fix-error.patch @@ -0,0 +1,29 @@ +diff --git a/nfs-logtools-1.0.0/logtools.cpp b/nfs-logtools-1.0.0/logtools.cpp +index 6d7d36f..7524ad7 100644 +--- a/nfs-logtools-1.0.0/logtools.cpp ++++ b/nfs-logtools-1.0.0/logtools.cpp +@@ -282,7 +282,7 @@ void Logtools::logtoolsGetHomePath() + void Logtools::logtoolsMessagesBox() + { + QMessageBox box(QMessageBox::Information, "提示", "该日志文件为空或不存在!"); +- box.setButtonText(QMessageBox::OK, QString(" 确 定")); ++ box.setButtonText(QMessageBox::Ok, QString(" 确 定")); + box.exec(); + } + +diff --git a/nfs-logtools-1.0.0/main.cpp b/nfs-logtools-1.0.0/main.cpp +index 32ec383..decdbc1 100644 +--- a/nfs-logtools-1.0.0/main.cpp ++++ b/nfs-logtools-1.0.0/main.cpp +@@ -6,6 +6,11 @@ + int main(int argc, char *argv[]) + { + qputenv("XDG_RUNTIME_DIR", "/tmp/runtime-root"); ++ ++ if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) { ++ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); ++ } ++ + QApplication a(argc, argv); + + //防止进程多开 -- Gitee