From 58ef127c304c5416f84176cf397c9097f9f66c3f Mon Sep 17 00:00:00 2001
From: tanyulong2021 <tanyulong@kylinos.cn>
Date: Tue, 2 Aug 2022 10:40:33 +0800
Subject: [PATCH] static applet uses UseHighDpiPixmaps

---
 ukui-power-statistics/main.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ukui-power-statistics/main.cpp b/ukui-power-statistics/main.cpp
index b63d88f..aeba9c3 100644
--- a/ukui-power-statistics/main.cpp
+++ b/ukui-power-statistics/main.cpp
@@ -43,6 +43,12 @@ int main(int argc, char *argv[])
 //        qDebug()<<"for example: ./run --device battery";
 //        return 0;
 //    }
+    if(QApplication::desktop()->width()>=2560){
+    #if(QT_VERSION >= QT_VERSION_CHECK(5,6,0))
+       QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);	
+       QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);	
+    #endif			
+    }	
     QString locale = QLocale::system().name();
     QTranslator translator;
     QString qmfile = QString(":/locale/%1.qm").arg(locale);
-- 
2.33.0

