Эх сурвалжийг харах

V0.8.4
1、修改了所有QSS的字体字重,全部取消

Apple 2 сар өмнө
parent
commit
90a3f5d256
27 өөрчлөгдсөн 424 нэмэгдсэн , 116 устгасан
  1. 2 2
      TransmitterSwitch/CMakeLists.txt
  2. 2 2
      TransmitterSwitch/Resource/QSS/black/SelectDate/calendarnav.qss
  3. 5 5
      TransmitterSwitch/Resource/QSS/black/SelectTime/timepartwidget.qss
  4. 8 8
      TransmitterSwitch/Resource/QSS/black/addnormalitem.qss
  5. 8 8
      TransmitterSwitch/Resource/QSS/black/addspecialitem.qss
  6. 3 3
      TransmitterSwitch/Resource/QSS/black/importtemplate.qss
  7. 6 6
      TransmitterSwitch/Resource/QSS/black/oneitem.qss
  8. 2 2
      TransmitterSwitch/Resource/QSS/black/savetotemplate.qss
  9. 6 6
      TransmitterSwitch/Resource/QSS/black/transmitterswitch.qss
  10. 3 3
      TransmitterSwitch/Resource/QSS/black/warning.qss
  11. 2 2
      TransmitterSwitch/Resource/QSS/white/SelectDate/calendarnav.qss
  12. 5 5
      TransmitterSwitch/Resource/QSS/white/SelectTime/timepartwidget.qss
  13. 8 8
      TransmitterSwitch/Resource/QSS/white/addnormalitem.qss
  14. 8 8
      TransmitterSwitch/Resource/QSS/white/addspecialitem.qss
  15. 3 3
      TransmitterSwitch/Resource/QSS/white/importtemplate.qss
  16. 4 4
      TransmitterSwitch/Resource/QSS/white/oneitem.qss
  17. 2 2
      TransmitterSwitch/Resource/QSS/white/savetotemplate.qss
  18. 5 5
      TransmitterSwitch/Resource/QSS/white/transmitterswitch.qss
  19. 3 3
      TransmitterSwitch/Resource/QSS/white/warning.qss
  20. 10 8
      TransmitterSwitch/Template/importtemplate.cpp
  21. 2 2
      TransmitterSwitch/Template/importtemplate.h
  22. 10 8
      TransmitterSwitch/Template/savetotemplate.cpp
  23. 2 2
      TransmitterSwitch/Template/savetotemplate.h
  24. 190 0
      TransmitterSwitch/common/Thread/threadcontroller.cpp
  25. 112 0
      TransmitterSwitch/common/Thread/threadcontroller.h
  26. 11 9
      TransmitterSwitch/common/warning/warning.cpp
  27. 2 2
      TransmitterSwitch/common/warning/warning.h

+ 2 - 2
TransmitterSwitch/CMakeLists.txt

@@ -13,7 +13,6 @@ file(GLOB LOCAL_SRC
 
     # ${CMAKE_CURRENT_SOURCE_DIR}/StyleManager/*.cpp
 
-    ${CMAKE_SOURCE_DIR}/External/common/Thread/*.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/WebAPI/*.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/Resource/*.qrc
     ${CMAKE_CURRENT_SOURCE_DIR}/WidgetItems/*.cpp
@@ -23,6 +22,7 @@ file(GLOB LOCAL_SRC
     ${CMAKE_CURRENT_SOURCE_DIR}/Template/*.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/warnning/*.cpp
 
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/Thread/*.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/common/Shadow/*.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/common/ImageBlur/*.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/common/combobox/*.cpp
@@ -55,7 +55,6 @@ target_include_directories(${lib_name} PRIVATE
 
     # ${CMAKE_CURRENT_SOURCE_DIR}/StyleManager
 
-    ${CMAKE_SOURCE_DIR}/External/common/Thread
 
     ${CMAKE_CURRENT_SOURCE_DIR}/WebAPI
     ${CMAKE_CURRENT_SOURCE_DIR}/WidgetItems
@@ -66,6 +65,7 @@ target_include_directories(${lib_name} PRIVATE
     ${CMAKE_CURRENT_SOURCE_DIR}/warnning
 
     ${CMAKE_CURRENT_SOURCE_DIR}/common
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/Thread
     ${CMAKE_CURRENT_SOURCE_DIR}/common/nlohmann
     ${CMAKE_CURRENT_SOURCE_DIR}/common/Shadow
     ${CMAKE_CURRENT_SOURCE_DIR}/common/ImageBlur

+ 2 - 2
TransmitterSwitch/Resource/QSS/black/SelectDate/calendarnav.qss

@@ -58,7 +58,7 @@ QPushButton#btnNextYear
 
 QLabel 
 {
-	font-size: 14px;
-	font-weight: 500;
+	font-size: 16px;
+	/* font-weight: 500; */
 	/* color: #3A3F63; */
 }

+ 5 - 5
TransmitterSwitch/Resource/QSS/black/SelectTime/timepartwidget.qss

@@ -10,7 +10,7 @@ QListWidget
 {
 	/* font-family:"Source Han Sans CN"; */
     font-size: 14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color: rgba(255,255,255,0.9);
 	border: none;
 	border-right: 1px solid rgba(0, 0, 0, 0.06);
@@ -22,8 +22,8 @@ QListView::item:hover
 	/* background-color: rgb(245,245,245); */
     background-color: rgb(227, 238, 255);
 	/* font-family:"Source Han Sans CN"; */
-    font-size: 14px;
-    font-weight: 400;
+    /* font-size: 14px; */
+    /* font-weight:400; */
     color: "#3A3F63";
 }
 
@@ -32,8 +32,8 @@ QListView::item:selected
 	/* background-color: rgb(227, 238, 255); */
     background-color: #438EFF;
 	/* font-family:"Source Han Sans CN"; */
-    font-size: 14px;
-    font-weight: 500;
+    /* font-size: 14px; */
+    /* font-weight: 500; */
     color: rgba(255,255,255,0.9);
 	outline: none;
 }

+ 8 - 8
TransmitterSwitch/Resource/QSS/black/addnormalitem.qss

@@ -5,7 +5,7 @@
 QWidget
 {
     /* font-family: 思源黑体R; */
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #D2D2D2;
     line-height: 21px;
@@ -40,7 +40,7 @@ QWidget#widget_Top
 QLabel#label_title
 {
     background: transparent;
-    font-weight: normal;
+    /* font-weight: normal; */
     font-size: 18px;
     color: #EBEBEB;
     line-height: 27px;
@@ -112,7 +112,7 @@ QPushButton#pBtn_ok:hover
 
 QLabel#label_devWarn,QLabel#label_timeWarn,QLabel#label_actionWarn
 {
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #D21F21;
     line-height: 21px;
@@ -130,7 +130,7 @@ QComboBox:enabled
     border: 1px solid rgba(255,255,255,0.15);
     border-radius: 4px;
     font-size:14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color:#D2D2D2;
     padding-left: 12px;
 }
@@ -142,7 +142,7 @@ QComboBox:enabled[Warn=true]
     border: 1px solid #D21F21;
     border-radius: 4px;
     font-size:14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color:#3A3F63;
     padding-left: 12px;
 }
@@ -154,7 +154,7 @@ QComboBox:!enabled
 	border: 1px solid #E6E9F4;
     border-radius: 4px;
     font-size:14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color:rgba(58,63,99,0.65);
     padding-left: 12px;
 }
@@ -266,7 +266,7 @@ QPushButton#pBtn_selectTime
     border: 1px solid rgba(255,255,255,0.15);
     border-radius: 4px;
     font-size: 14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     padding-left: 12px;
     text-align: left;
 }
@@ -278,7 +278,7 @@ QPushButton#pBtn_selectTime:hover
     border: 1px solid #438EFF;
     border-radius: 4px;
     font-size: 14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     padding-left: 12px;
     text-align: left;
 }

+ 8 - 8
TransmitterSwitch/Resource/QSS/black/addspecialitem.qss

@@ -5,7 +5,7 @@
 QWidget
 {
     /* font-family: 思源黑体R; */
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #D2D2D2;
     line-height: 21px;
@@ -38,7 +38,7 @@ QWidget#widget_Top
 QLabel#label_title
 {
     background: transparent;
-    font-weight: normal;
+    /* font-weight: normal; */
     font-size: 18px;
     color: #EBEBEB;
     line-height: 27px;
@@ -108,7 +108,7 @@ QPushButton#pBtn_ok:hover
 
 QLabel#label_devWarn,QLabel#label_timeWarn,QLabel#label_actionWarn
 {
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #D21F21;
     line-height: 21px;
@@ -126,7 +126,7 @@ QComboBox:enabled
     border: 1px solid rgba(255,255,255,0.15);
     border-radius: 4px;
     font-size:14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color:#D2D2D2;
     padding-left: 12px;
 }
@@ -137,7 +137,7 @@ QComboBox:enabled[Warn=true]
     border: 1px solid #D21F21;
     border-radius: 4px;
     font-size:14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color:#3A3F63;
     padding-left: 12px;
 }
@@ -149,7 +149,7 @@ QComboBox:!enabled
 	border: 1px solid #E6E9F4;
     border-radius: 4px;
     font-size:14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color:rgba(58,63,99,0.65);
     padding-left: 12px;
 }
@@ -260,7 +260,7 @@ QPushButton#pBtn_selectTime
     border: 1px solid rgba(255,255,255,0.15);
     border-radius: 4px;
     font-size: 14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     padding-left: 12px;
     text-align: left;
 }
@@ -272,7 +272,7 @@ QPushButton#pBtn_selectTime:hover
     border: 1px solid #438EFF;
     border-radius: 4px;
     font-size: 14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     padding-left: 12px;
     text-align: left;
 }

+ 3 - 3
TransmitterSwitch/Resource/QSS/black/importtemplate.qss

@@ -4,7 +4,7 @@ QWidget
     border-radius: 8px;
 
     /* font-family: 思源黑体R; */
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #D2D2D2;
     line-height: 21px;
@@ -28,7 +28,7 @@ QWidget#widget_Top
 
 QLabel#label_title
 {
-    font-weight: normal;
+    /* font-weight: normal; */
     font-size: 18px;
     color: #D2D2D2;
     line-height: 27px;
@@ -110,7 +110,7 @@ QPushButton#pBtn_ok:hover
 /* 标题栏 */
 QLabel#label_NC2, #label_NC3, #label_NC4
 {
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #D2D2D2;
     line-height: 21px;

+ 6 - 6
TransmitterSwitch/Resource/QSS/black/oneitem.qss

@@ -2,7 +2,7 @@
 QWidget
 {
     /* font-family: 思源黑体R; */
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #D2D2D2;
     line-height: 22px;
@@ -105,7 +105,7 @@ QComboBox
 	background-color: #313539;
 	border-radius: 4px;
 	border: 1px solid #313539;
-	font-weight: 400;
+	/* font-weight: 400; */
 	font-size: 14px;
 	color: #D2D2D2;
 	padding-left: 12px;
@@ -142,19 +142,19 @@ QComboBox QAbstractItemView::item
 	color: #D2D2D2;
     height: 32px;
 	background-color: #5C5E61;
-	font-weight: 400;
+	/* font-weight: 400; */
 	font-size: 14px;
 	padding-left: 12px;
 }
 QComboBox QAbstractItemView::item:hover 
 {
-	font-weight: 400;
+	/* font-weight: 400; */
     color: #FFFFFF;
 	background-color: #438EFF;
 }
 QComboBox QAbstractItemView::item:selected 
 {
-	font-weight: 400;
+	/* font-weight: 400; */
     color: #FFFFFF;
 	background-color: #438EFF;
 }
@@ -166,7 +166,7 @@ QComboBox QAbstractItemView::item:selected
 
 QLabel#label_warnning
 {
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #D21F21;
     line-height: 21px;

+ 2 - 2
TransmitterSwitch/Resource/QSS/black/savetotemplate.qss

@@ -3,7 +3,7 @@ QWidget
     background: #FFFFFF;
     border-radius: 8px;
     /* font-family: 思源黑体R; */
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #D2D2D2;
     line-height: 21px;
@@ -29,7 +29,7 @@ QWidget#widget_Top
 QLabel#label_title
 {
     /* font-family: 思源黑体M; */
-    font-weight: normal;
+    /* font-weight: normal; */
     font-size: 18px;
     color: #EBEBEB;
     line-height: 27px;

+ 6 - 6
TransmitterSwitch/Resource/QSS/black/transmitterswitch.qss

@@ -3,7 +3,7 @@
 QWidget
 {
     /* font-family: 思源黑体R; */
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #B1B3B4;
     line-height: 22px;
@@ -26,7 +26,7 @@ QWidget#widget
 QPushButton
 {
     /* font-family: 思源黑体M; */
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #D2D2D2;
     line-height: 22px;
@@ -109,8 +109,8 @@ QWidget#widget_weekpBtn
 /* 周几按钮 */
 QPushButton#pBtn_Monday, #pBtn_Tuesday, #pBtn_Wednesday, #pBtn_Thursday, #pBtn_Friday, #pBtn_Saturday, #pBtn_Sunday, #pBtn_SpecialDay
 {
-    font-weight: 600;
-    font-size: 14px;
+    /* font-weight: normal;
+    font-size: 14px; */
 
     text-align: left;
     padding-left: 19px;
@@ -121,8 +121,8 @@ QPushButton#pBtn_Monday, #pBtn_Tuesday, #pBtn_Wednesday, #pBtn_Thursday, #pBtn_F
 
 QPushButton#pBtn_Monday:checked, #pBtn_Tuesday:checked, #pBtn_Wednesday:checked, #pBtn_Thursday:checked, #pBtn_Friday:checked, #pBtn_Saturday:checked, #pBtn_Sunday:checked, #pBtn_SpecialDay:checked
 {
-    font-weight: 600;
-    font-size: 14px;
+    /* font-weight: normal;
+    font-size: 14px; */
     
     text-align: left;
     padding-left: 19px;

+ 3 - 3
TransmitterSwitch/Resource/QSS/black/warning.qss

@@ -3,7 +3,7 @@ QWidget
     background: transparent;
     border-radius: 8px;
     /* font-family: 思源黑体R; */
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 18px;
     color: #D2D2D2;
     line-height: 21px;
@@ -28,7 +28,7 @@ QWidget#widget_Top
 QLabel#label_title
 {
     /* font-family: 思源黑体M; */
-    font-weight: normal;
+    /* font-weight: normal; */
     font-size: 18px;
     color: #D2D2D2;
     line-height: 27px;
@@ -49,7 +49,7 @@ QLabel#label_warnIcon
 QLabel#label_Warn
 {
 	/* font-family: 思源黑体R; */
-	font-weight: 400;
+	/* font-weight: 400; */
 	font-size: 18px;
 	color: #D2D2D2;
 	line-height: 27px;

+ 2 - 2
TransmitterSwitch/Resource/QSS/white/SelectDate/calendarnav.qss

@@ -44,7 +44,7 @@ QPushButton#btnNextYear
 
 QLabel 
 {
-	font-size: 14px;
-	font-weight: 500;
+	font-size: 16px;
+	/* font-weight: 500; */
 	color: #3A3F63;
 }

+ 5 - 5
TransmitterSwitch/Resource/QSS/white/SelectTime/timepartwidget.qss

@@ -2,7 +2,7 @@ QListWidget
 {
 	/* font-family:"Source Han Sans CN"; */
     font-size: 14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color: "#3A3F63";
 	border: none;
 	border-right: 1px solid rgba(0, 0, 0, 0.06);
@@ -13,8 +13,8 @@ QListView::item:hover
 {
 	background-color: rgb(245,245,245);
 	/* font-family:"Source Han Sans CN"; */
-    font-size: 14px;
-    font-weight: 400;
+    /* font-size: 18px; */
+    /* font-weight: 400; */
     color: "#3A3F63";
 }
 
@@ -22,8 +22,8 @@ QListView::item:selected
 {
 	background-color: rgb(227, 238, 255);
 	/* font-family:"Source Han Sans CN"; */
-    font-size: 14px;
-    font-weight: 500;
+    /* font-size: 14px; */
+    /* font-weight: 500; */
     color: "#3A3F63";
 	outline: none;
 }

+ 8 - 8
TransmitterSwitch/Resource/QSS/white/addnormalitem.qss

@@ -5,7 +5,7 @@
 QWidget
 {
     /* font-family: 思源黑体R; */
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #3A3F63;
     line-height: 21px;
@@ -38,7 +38,7 @@ QWidget#widget_background
 
 QLabel#label_title
 {
-    font-weight: normal;
+    /* font-weight: normal; */
     font-size: 18px;
     color: #3A3F63;
     line-height: 27px;
@@ -110,7 +110,7 @@ QPushButton#pBtn_ok:hover
 
 QLabel#label_devWarn,QLabel#label_timeWarn,QLabel#label_actionWarn
 {
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #D21F21;
     line-height: 21px;
@@ -128,7 +128,7 @@ QComboBox:enabled
     border: 1px solid #E6E9F4;
     border-radius: 4px;
     font-size:14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color:#3A3F63;
     padding-left: 12px;
 }
@@ -139,7 +139,7 @@ QComboBox:enabled[Warn=true]
     border: 1px solid #D21F21;
     border-radius: 4px;
     font-size:14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color:#3A3F63;
     padding-left: 12px;
 }
@@ -152,7 +152,7 @@ QComboBox:!enabled
 	border: 1px solid #E6E9F4;
     border-radius: 4px;
     font-size:14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color:rgba(58,63,99,0.65);
     padding-left: 12px;
 }
@@ -283,7 +283,7 @@ QPushButton#pBtn_selectTime
     border: 1px solid #E6E9F4;
     border-radius: 4px;
     font-size: 14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color: #3A3F63;
     padding-left: 12px;
     text-align: left;
@@ -296,7 +296,7 @@ QPushButton#pBtn_selectTime:hover
     border: 1px solid #4458FE;
     border-radius: 4px;
     font-size: 14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color: #3A3F63;
     padding-left: 12px;
     text-align: left;

+ 8 - 8
TransmitterSwitch/Resource/QSS/white/addspecialitem.qss

@@ -5,7 +5,7 @@
 QWidget
 {
     /* font-family: 思源黑体R; */
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #3A3F63;
     line-height: 21px;
@@ -33,7 +33,7 @@ QWidget#widget_Top
 
 QLabel#label_title
 {
-    font-weight: normal;
+    /* font-weight: normal; */
     font-size: 18px;
     color: #3A3F63;
     line-height: 27px;
@@ -105,7 +105,7 @@ QPushButton#pBtn_ok:hover
 
 QLabel#label_devWarn,QLabel#label_timeWarn,QLabel#label_actionWarn
 {
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #D21F21;
     line-height: 21px;
@@ -123,7 +123,7 @@ QComboBox:enabled
     border: 1px solid #E6E9F4;
     border-radius: 4px;
     font-size:14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color:#3A3F63;
     padding-left: 12px;
 }
@@ -134,7 +134,7 @@ QComboBox:enabled[Warn=true]
     border: 1px solid #D21F21;
     border-radius: 4px;
     font-size:14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color:#3A3F63;
     padding-left: 12px;
 }
@@ -147,7 +147,7 @@ QComboBox:!enabled
 	border: 1px solid #E6E9F4;
     border-radius: 4px;
     font-size:14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color:rgba(58,63,99,0.65);
     padding-left: 12px;
 }
@@ -269,7 +269,7 @@ QPushButton#pBtn_selectTime
     border: 1px solid #E6E9F4;
     border-radius: 4px;
     font-size: 14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color: #3A3F63;
     padding-left: 12px;
     text-align: left;
@@ -282,7 +282,7 @@ QPushButton#pBtn_selectTime:hover
     border: 1px solid #4458FE;
     border-radius: 4px;
     font-size: 14px;
-    font-weight: 400;
+    /* font-weight: 400; */
     color: #3A3F63;
     padding-left: 12px;
     text-align: left;

+ 3 - 3
TransmitterSwitch/Resource/QSS/white/importtemplate.qss

@@ -4,7 +4,7 @@ QWidget
     border-radius: 8px;
 
     /* font-family: 思源黑体R; */
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #3A3F63;
     line-height: 21px;
@@ -29,7 +29,7 @@ QWidget#widget_Top
 
 QLabel#label_title
 {
-    font-weight: normal;
+    /* font-weight: normal; */
     font-size: 18px;
     color: #3A3F63;
     line-height: 27px;
@@ -40,7 +40,7 @@ QLabel#label_title
 
 QLabel#label_NC2,QLabel#label_NC3,QLabel#label_NC4
 {
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #5A607F;
     line-height: 21px;

+ 4 - 4
TransmitterSwitch/Resource/QSS/white/oneitem.qss

@@ -106,7 +106,7 @@ QComboBox
     background: transparent;
 	border-radius: 4px;
 	border: 1px solid #E6E9F4;
-	font-weight: 400;
+	/* font-weight: 400; */
 	font-size: 14px;
 	color: #3A3F63;
 	padding-left: 12px;
@@ -145,14 +145,14 @@ QComboBox QAbstractItemView::item
     /* background: transparent; */
     border-radius: 4px;
     height: 32px;
-	font-weight: 400;
+	/* font-weight: 400; */
 	font-size: 14px;
 	padding-left: 12px;
 }
 QComboBox QAbstractItemView::item:hover 
 {
     color: #3A3F63;
-	font-weight: 400;
+	/* font-weight: 400; */
 	background-color: #EEF2FF;
 }
 /* QComboBox QAbstractItemView::item:selected 
@@ -169,7 +169,7 @@ QComboBox QAbstractItemView::item:hover
 
 QLabel#label_warnning
 {
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #D21F21;
     line-height: 21px;

+ 2 - 2
TransmitterSwitch/Resource/QSS/white/savetotemplate.qss

@@ -3,7 +3,7 @@ QWidget
     background: #FFFFFF;
     border-radius: 8px;
     /* font-family: 思源黑体R; */
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #3A3F63;
     line-height: 21px;
@@ -24,7 +24,7 @@ QWidget#widget_Top
 QLabel#label_title
 {
     /* font-family: 思源黑体M; */
-    font-weight: normal;
+    /* font-weight: normal; */
     font-size: 18px;
     color: #3A3F63;
     line-height: 27px;

+ 5 - 5
TransmitterSwitch/Resource/QSS/white/transmitterswitch.qss

@@ -3,7 +3,7 @@
 QWidget
 {
     /* font-family: 思源黑体R; */
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     color: #1D2129;
     line-height: 22px;
@@ -106,7 +106,7 @@ QWidget#widget_weekpBtn
 /* 周几按钮 */
 QPushButton#pBtn_Monday, #pBtn_Tuesday, #pBtn_Wednesday, #pBtn_Thursday, #pBtn_Friday, #pBtn_Saturday, #pBtn_Sunday, #pBtn_SpecialDay
 {
-    font-weight: 600;
+    /* font-weight: normal; */
     font-size: 14px;
 
     background-color: #F5F5FA;
@@ -120,7 +120,7 @@ QPushButton#pBtn_Monday, #pBtn_Tuesday, #pBtn_Wednesday, #pBtn_Thursday, #pBtn_F
 
 QPushButton#pBtn_Monday:checked, #pBtn_Tuesday:checked, #pBtn_Wednesday:checked, #pBtn_Thursday:checked, #pBtn_Friday:checked, #pBtn_Saturday:checked, #pBtn_Sunday:checked, #pBtn_SpecialDay:checked
 {
-    font-weight: 600;
+    /* font-weight: normal; */
     font-size: 14px;
 
     color:#4458FE;
@@ -145,7 +145,7 @@ QWidget#widget_bottom
 
 QPushButton#pBtn_addPlan, QPushButton#pBtn_clearPlan, QPushButton#pBtn_importPlan, QPushButton#pBtn_exportPlan
 {
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     /* font-family: 思源黑体M; */
     background-color: #FFFFFF;
@@ -155,7 +155,7 @@ QPushButton#pBtn_addPlan, QPushButton#pBtn_clearPlan, QPushButton#pBtn_importPla
 
 QPushButton#pBtn_addPlan:hover, #pBtn_clearPlan:hover, #pBtn_importPlan:hover, #pBtn_exportPlan:hover
 {
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 14px;
     /* font-family: 思源黑体M; */
     color: #4458FE;

+ 3 - 3
TransmitterSwitch/Resource/QSS/white/warning.qss

@@ -3,7 +3,7 @@ QWidget
     background: transparent;
     border-radius: 8px;
     /* font-family: 思源黑体R; */
-    font-weight: 400;
+    /* font-weight: 400; */
     font-size: 18px;
     color: #3A3F63;
     line-height: 21px;
@@ -29,7 +29,7 @@ QWidget#widget_Top
 QLabel#label_title
 {
     /* font-family: 思源黑体M; */
-    font-weight: normal;
+    /* font-weight: normal; */
     font-size: 18px;
     color: #3A3F63;
     line-height: 27px;
@@ -50,7 +50,7 @@ QLabel#label_warnIcon
 QLabel#label_Warn
 {
 	/* font-family: 思源黑体R; */
-	font-weight: 400;
+	/* font-weight: 400; */
 	font-size: 18px;
 	color: #3A3F63;
 	line-height: 27px;

+ 10 - 8
TransmitterSwitch/Template/importtemplate.cpp

@@ -11,7 +11,7 @@
 #include "warning/warning.h"
 // #include "lhstylemanager.h"
 #include "LHQLogAPI.h"
-#include "oneshadow.h"
+#include "OneShadowEffect.h"
 #include "TransmitterSwitchInfo.h"
 
 ImportTemplate::ImportTemplate(QStringList& tabList,QWidget *parent) :
@@ -37,7 +37,9 @@ ImportTemplate::ImportTemplate(QStringList& tabList,QWidget *parent) :
     size.setWidth(size.width() - 32);
     size.setHeight(size.height() - 32);
 
-    m_shadow = new OneShadow(size, 16);
+    // m_shadow = new OneShadow(size, 16);
+    auto pShadow = new OneShadowEffect(this);
+    this->setGraphicsEffect(pShadow);
 
     m_templateName.clear();
 
@@ -191,12 +193,12 @@ void ImportTemplate::setQSSPath(const QString& qssPath)
 }
 
 /* 绘画事件 */
-void ImportTemplate::paintEvent(QPaintEvent *event)
-{
-    QPainter painter(this);
-    painter.setRenderHint(QPainter::Antialiasing);
-    painter.drawImage(QPoint(0, 0), m_shadow->image());
-}
+// void ImportTemplate::paintEvent(QPaintEvent *event)
+// {
+//     QPainter painter(this);
+//     painter.setRenderHint(QPainter::Antialiasing);
+//     painter.drawImage(QPoint(0, 0), m_shadow->image());
+// }
 
 /* 事件过滤器 */
 bool ImportTemplate::eventFilter(QObject *watched, QEvent *event)

+ 2 - 2
TransmitterSwitch/Template/importtemplate.h

@@ -41,7 +41,7 @@ private slots:
 
 protected:
     /* 绘画事件 */
-    void paintEvent(QPaintEvent *event) override;
+    // void paintEvent(QPaintEvent *event) override;
     /* 事件过滤器 */
     bool eventFilter(QObject *watched, QEvent *event) override;
     /* 鼠标点击事件 */
@@ -56,7 +56,7 @@ private:
 
     bool m_isOk = false;                                                    /* 是否点下了OK */
     QString m_templateName;                                                 /* 模版名称 */
-    OneShadow* m_shadow = nullptr;                                          /* 阴影 */
+    // OneShadow* m_shadow = nullptr;                                          /* 阴影 */
 
     QPoint m_lastPos;                       /* 鼠标点击的位置 */
 };

+ 10 - 8
TransmitterSwitch/Template/savetotemplate.cpp

@@ -8,7 +8,7 @@
 
 // #include "lhstylemanager.h"
 #include "LHQLogAPI.h"
-#include "oneshadow.h"
+#include "OneShadowEffect.h"
 
 SaveToTemplate::SaveToTemplate(QWidget *parent) :
     QDialog(parent),
@@ -33,7 +33,9 @@ SaveToTemplate::SaveToTemplate(QWidget *parent) :
     QSize size = this->size();
     size.setWidth(size.width() - 32);
     size.setHeight(size.height() - 32);
-    m_shadow = new OneShadow(size, 16);
+    // m_shadow = new OneShadow(size, 16);
+    auto pShadow = new OneShadowEffect(this);
+    this->setGraphicsEffect(pShadow);
 
     m_templateNameList.clear();
 
@@ -162,12 +164,12 @@ void SaveToTemplate::setWarning(bool flag)
 
 
 /* 绘画事件 */
-void SaveToTemplate::paintEvent(QPaintEvent *event)
-{
-    QPainter painter(this);
-    painter.setRenderHint(QPainter::Antialiasing);
-    painter.drawImage(QPoint(0, 0), m_shadow->image());
-}
+// void SaveToTemplate::paintEvent(QPaintEvent *event)
+// {
+//     QPainter painter(this);
+//     painter.setRenderHint(QPainter::Antialiasing);
+//     painter.drawImage(QPoint(0, 0), m_shadow->image());
+// }
 
 
 bool SaveToTemplate::eventFilter(QObject *watched, QEvent *event)

+ 2 - 2
TransmitterSwitch/Template/savetotemplate.h

@@ -46,7 +46,7 @@ private:
 
 protected:
     /* 绘画事件 */
-    void paintEvent(QPaintEvent *event) override;
+    // void paintEvent(QPaintEvent *event) override;
     /* 事件过滤器 */
     bool eventFilter(QObject *watched, QEvent *event) override;
     /* 鼠标点击事件 */
@@ -65,7 +65,7 @@ private:
 
     bool m_isOk = false;                    /* 是否点击了确定 */
     QString m_templateName;                 /* 模板名称 */
-    OneShadow* m_shadow = nullptr;          /* 阴影 */
+    // OneShadow* m_shadow = nullptr;          /* 阴影 */
 
     QPoint m_lastPos;                       /* 鼠标点击的位置 */
 };

+ 190 - 0
TransmitterSwitch/common/Thread/threadcontroller.cpp

@@ -0,0 +1,190 @@
+#include "threadcontroller.h"
+#include <QDebug>
+
+#if defined(Q_OS_WIN32)
+#include <windows.h>
+#include <tlhelp32.h>
+#endif
+
+#include <QPointer>
+
+/* 获取线程数 */
+int ThreadUtility::GetThreadCount(int processID)
+{
+#if defined(Q_OS_WIN32)
+    PROCESSENTRY32 pe32;
+    pe32.dwSize = sizeof(pe32);
+  
+    HANDLE hProcessSnap = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
+    if (hProcessSnap == INVALID_HANDLE_VALUE)
+    {
+      qDebug()<<"CreateToolhelp32Snapshot 调用失败";
+      return -1;
+    }
+    BOOL bMore = ::Process32First(hProcessSnap, &pe32);
+  
+    //printf("%-30s %-20s %-20s %-15s\n","szExeFile","th32ProcessID","th32ParentProcessID","cntThreads");
+    while(bMore)
+    {
+      //printf("%-30s ",pe32.szExeFile);
+      //printf("%-20d ",pe32.th32ProcessID);
+      //printf("%-20d",pe32.th32ParentProcessID);
+      ////显示进程的线程数
+      //printf("%-15d\n",pe32.cntThreads);
+      //int pid = getpid();
+      bMore = Process32Next(hProcessSnap, &pe32);
+      if(static_cast<int>(pe32.th32ProcessID) == processID)
+      {
+          //qDebug()<<"进程名称 = "<<QString::fromWCharArray(pe32.szExeFile);
+          //qDebug()<<"进程ID = "<<pe32.th32ProcessID;
+          //qDebug()<<"线程数量 = "<<pe32.cntThreads;
+          return static_cast<int>(pe32.cntThreads);
+      }
+    }
+    return -1;
+#elif defined(Q_OS_LINUX)
+    return -1;
+#endif
+}
+bool ThreadUtility::BlockExitThread(QThread *thread, unsigned long msecs)
+{
+    thread->quit();
+    thread->requestInterruption();
+    bool isSuccess = false;
+    if(!thread->wait(msecs))
+    {
+        qDebug()<<"线程异常结束"<<thread;
+        thread->terminate();
+        if(!thread->wait(20000)) qDebug()<<"线程terminate异常";
+    }
+    else
+    {
+        qDebug()<<"线程正常结束"<<thread;
+        isSuccess = true;
+    }
+    return isSuccess;
+}
+/* 工作线程 */
+ThreadWorker::ThreadWorker()
+    : QObject(nullptr)
+    , m_pWorkTimer(nullptr)
+    , m_bInited(false)
+    , m_nInterval(1000)
+{
+    m_pWorkTimer = new QTimer(nullptr);
+    connect(m_pWorkTimer, &QTimer::timeout, this, &ThreadWorker::OnWorkTimer, Qt::QueuedConnection);
+    connect(this, &ThreadWorker::sig_StartWorkTimer, this, &ThreadWorker::OnStartWorkTimer, Qt::QueuedConnection);
+    
+    QThread *pHostThread = new QThread(nullptr);
+    pHostThread->start();
+    moveToThread(pHostThread);                      /* 将本实例移动到新线程中,其实就是将事件循环等移过去 */
+    m_pWorkTimer->moveToThread(pHostThread);        /* 将定时器移到新线程中,定时器触发的槽函数就会运行在新线程中 */
+    /*----------------------------------------------------------------
+     * 对线程执行quit会发生: 结束线程的事件循环(线程里的对象不再能接受任何信号, 除了deleteLater), 发送finished信号
+     * 宿主线程对象和工作对象都在同一个线程, 所以用DirectConnection
+     * 这里是一个序列: 对线程执行quit -> 线程发送finished信号 -> 工作对象释放 -> 线程对象释放
+    ----------------------------------------------------------------*/
+    connect(pHostThread, &QThread::finished, this, &ThreadWorker::deleteLater, Qt::DirectConnection);
+    connect(this, &ThreadWorker::destroyed, pHostThread, &QThread::deleteLater, Qt::DirectConnection);
+    
+    WorkerCollector::Instance()->AddWorker(this);
+}
+
+ThreadWorker::~ThreadWorker()
+{
+    
+}
+//在子线程执行(m_pWorkTimer已被移至线程)
+void ThreadWorker::OnStartWorkTimer(int msecs)
+{
+    m_nInterval = (msecs==-1)?10:msecs;
+    if(msecs == -1) m_pWorkTimer->setSingleShot(true);
+    m_pWorkTimer->start(0);
+}
+
+//Start方法被主线程调用, 内容在主线程执行
+void ThreadWorker::Start(int interval)
+{
+    QMutexLocker lockerInited(&m_mutexInited);
+    m_bInited = false;
+    emit sig_StartWorkTimer(interval);
+}
+
+void ThreadWorker::NonBlockStop()
+{
+    QThread *pThread = dynamic_cast<QThread*>(thread());
+    if(pThread == nullptr) return;
+    pThread->quit();
+    pThread->requestInterruption();
+}
+//该方法只能被主线程调用
+//否则报错: Thread tried to wait on itself
+bool ThreadWorker::BlockStop(unsigned long msecs)
+{
+    return ThreadUtility::BlockExitThread(thread(), msecs);;
+}
+
+void ThreadWorker::SetInterval(int interval)
+{
+    m_pWorkTimer->setInterval(interval);
+}
+
+//OnWorkTimer在其他线程执行
+void ThreadWorker::OnWorkTimer()
+{
+    m_pWorkTimer->setInterval(m_nInterval);
+    /* 初始化锁 */
+    m_mutexInited.lock();
+    if(!m_bInited)
+    {
+        m_bInited = true;
+        DoInit();
+    }
+    m_mutexInited.unlock();
+
+    DoWork();
+    emit sig_Ticked(this);
+    //工作对象非循环且内容执行完毕
+    if(m_pWorkTimer->isSingleShot())
+    {
+        NonBlockStop();
+        return;
+    }
+    //主动调用NonBlockStop或BlockStop且未等待超时
+    if(thread()->isInterruptionRequested())
+    {
+        m_pWorkTimer->stop();
+        return;
+    }
+}
+
+WorkerCollector::CollectorGarbo WorkerCollector::garbo;
+WorkerCollector* WorkerCollector::sm_pInstance = new WorkerCollector();     //初始化静态单例(饿汉)
+
+//在这里释放那些: 直到程序结束还没有被释放的工作对象
+WorkerCollector::~WorkerCollector()
+{
+    sm_pInstance = nullptr;
+    auto pred = [](QPointer<ThreadWorker> x){return x != nullptr;};
+    QList<QPointer<ThreadWorker>> remainWorkers;
+    std::copy_if(m_listWorkers.begin(), m_listWorkers.end(), std::back_inserter(remainWorkers), pred);
+    qDebug() << "线程管理器释放: 待释放工作对象个数" << remainWorkers.count();
+    int counter = 0;
+    for(QPointer<ThreadWorker> pWorker: remainWorkers)
+    {
+        //注意: 这里如果是停止超时的情况, 说明工作对象正在执行内容, 直接调用delete可能会导致崩溃
+        //而且这里不能使用deleteLater来释放工作对象, 因为线程的事件循环已经退出了
+        if(!pWorker->BlockStop(5000)) continue;
+        delete pWorker;
+        counter++;
+    }
+    qDebug()<<"已释放工作对象: "<<counter;
+    m_listWorkers.clear();
+}
+
+void WorkerCollector::AddWorker(ThreadWorker *worker)
+{
+    QPointer<ThreadWorker> pWorker(worker);
+    m_listWorkers.append(pWorker);
+}
+

+ 112 - 0
TransmitterSwitch/common/Thread/threadcontroller.h

@@ -0,0 +1,112 @@
+/*----------------------------------------------------------------
+ *      概述
+ * 1, 使用movetothread的方式执行工作线程(因为这种方式是官方推荐)
+ * 2, 这种方式可以同时实现线程主动运行并且可以接收到Qt的事件循环
+ * ----------------------------------------------------------------
+ *      使用流程
+ * 1, 提供一个ThreadWorker类作为工作对象的基类, 工作对象继承它之后, 实现DoWork纯虚函数, 在函数里编写工作内容
+ * 2, 提供一个ThreadController类作为线程管理器的基类, 管理器继承它之后, 可以使用AddWorker方法传入工作对象, 管理器释放后会自动释放未停止的工作对象
+ * 3, 工作对象调用Start并传入循环间隔来开启线程
+ * 4, 工作对象调用BlockStop/NonBlockStop来阻塞/非阻塞地停止
+ * ----------------------------------------------------------------
+ *      特性
+ * 1, 代码分离, 使用者只要考虑实现工作内容, 工作对象的线程相关操作全部在基类实现
+ * 2, 阻塞/非阻塞两种方式停止线程, 停止时, 先释放工作对象再释放宿主线程
+ * 3, 当工作内容是无限阻塞, 可以使用阻塞方式并设置阻塞超时来停止线程, 但是工作对象不会被释放
+ * 4, 工作对象支持事件循环, 例如在woker实现类里使用tcp对象并监听readyRead信号
+ * 5, 非循环工作的工作对象执行完毕后, 自动释放, 宿主线程也会退出
+ * 6, 程序退出时, 阻塞式(可设置超时)释放所有未被释放的工作对象和宿主线程(不包括异常停止的工作对象)
+ * 7, 工作对象支持循环执行和单次执行
+ * 8, 这两种停止情况都能正常工作: dowork正在执行时; dowork的timer间隔期间
+ * 9, 支持外部监听工作对象被释放事件
+----------------------------------------------------------------*/
+#ifndef THREADUTILITY_H
+#define THREADUTILITY_H
+
+#include <QMutex>
+#include <QObject>
+#include <QPointer>
+#include <QThread>
+#include <QTimer>
+#include <QWaitCondition>
+
+/**
+ * @brief 这个函数是获取一些线程的状态
+ * 
+ */
+class ThreadUtility
+{
+public:
+    static int GetThreadCount(int processID);           /* 获取线程数 */
+    static bool BlockExitThread(QThread *thread, unsigned long msecs = ULONG_MAX);
+};
+
+/**
+ * 工作线程
+*/
+class ThreadWorker : public QObject
+{
+    Q_OBJECT
+public:
+    explicit ThreadWorker();
+    virtual ~ThreadWorker();
+    virtual void Start(int interval = -1);
+    virtual void NonBlockStop();
+    virtual bool BlockStop(unsigned long msecs = ULONG_MAX);
+    void SetInterval(int interval);
+protected:
+    virtual void DoInit() = 0;
+    virtual void DoWork() = 0;              /* 重写此函数,即可运行在新的线程中 */
+private slots:
+    void OnWorkTimer();                     /* OnWorkTimer在其新线程执行 */
+    void OnStartWorkTimer(int msecs);
+signals:
+    void sig_Ticked(ThreadWorker *self);
+    void sig_StartWorkTimer(int msecs);
+private:
+    QTimer *m_pWorkTimer;
+    bool m_bInited;
+    QMutex m_mutexInited;
+    int m_nInterval;
+};
+
+/**
+ * 控制线程
+*/
+class WorkerCollector : public QObject
+{
+    Q_OBJECT
+public:
+    static WorkerCollector* Instance(){return sm_pInstance;}
+    ~WorkerCollector();
+    void AddWorker(ThreadWorker *worker);
+private:
+    WorkerCollector(){}
+    //防拷贝, C++11
+    WorkerCollector(WorkerCollector const&) = delete;
+	WorkerCollector& operator=(WorkerCollector const&) = delete;
+private:
+    static WorkerCollector* sm_pInstance;     //单例实例
+    QList<QPointer<ThreadWorker>> m_listWorkers;    //包含所有的工作对象
+    
+    /*----------------------------------------------------------------
+     * 关于释放全局单例: 
+     * 一个妥善的方法是让这个类自己知道在合适的时候把自己删除; 或者说把删除自己的操作挂在系统中的某个合适的点上, 使其在恰当的时候自动被执行;
+     * 程序在结束的时候, 系统会自动析构所有的全局变量;事实上, 系统也会析构所有的类的静态成员变量, 就像这些静态成员也是全局变量一样;
+     * 利用这个特征, 我们可以在单例类中定义一个这样的静态成员变量, 而它的唯一工作就是在析构函数中删除单例类的实例;
+    ----------------------------------------------------------------*/
+private:
+    class CollectorGarbo
+    {
+    public:
+        ~CollectorGarbo()
+        {  
+            if (WorkerCollector::sm_pInstance != nullptr)
+                delete WorkerCollector::sm_pInstance;
+        }
+    };
+    static CollectorGarbo garbo;
+    /*----------------------------------------------------------------*/
+};
+
+#endif // THREADUTILITY_H

+ 11 - 9
TransmitterSwitch/common/warning/warning.cpp

@@ -8,7 +8,7 @@
 #include <QStyle>
 #include <QMouseEvent>
 
-#include "oneshadow.h"
+#include "OneShadowEffect.h"
 // #include "lhstylemanager.h"
 #include "LHQLogAPI.h"
 
@@ -41,7 +41,9 @@ Warning::Warning(QWidget *parent) :
 
     /* 阴影宽度是16 */
     this->layout()->setMargin(SHADOW_W);
-    m_shadow = new OneShadow(QSize(width() - SHADOW_W*2, height() - SHADOW_W*2),SHADOW_W);
+    // m_shadow = new OneShadow(QSize(width() - SHADOW_W*2, height() - SHADOW_W*2),SHADOW_W);
+    auto pShadow = new OneShadowEffect(this);
+    this->setGraphicsEffect(pShadow);
 
     connect(ui->pBtn_close,SIGNAL(clicked()),this,SLOT(close()));
     connect(ui->pBtn_cancel,SIGNAL(clicked()),this,SLOT(close()));
@@ -91,13 +93,13 @@ void Warning::setQSS(const QString& qssPath)
     }
 }
 
-void Warning::paintEvent(QPaintEvent *event)
-{
-    QPainter painter(this);
-    painter.setRenderHint(QPainter::Antialiasing);
-    /* 绘制阴影 */
-    painter.drawImage(QPoint(0,0),m_shadow->image());
-}
+// void Warning::paintEvent(QPaintEvent *event)
+// {
+//     QPainter painter(this);
+//     painter.setRenderHint(QPainter::Antialiasing);
+//     /* 绘制阴影 */
+//     painter.drawImage(QPoint(0,0),m_shadow->image());
+// }
 
 /* 事件过滤器 */
 bool Warning::eventFilter(QObject *watched, QEvent *event)

+ 2 - 2
TransmitterSwitch/common/warning/warning.h

@@ -27,7 +27,7 @@ signals:
     void signal_ok();
 
 protected:
-    void paintEvent(QPaintEvent *event) override;
+    // void paintEvent(QPaintEvent *event) override;
     /* 事件过滤器 */
     bool eventFilter(QObject *watched, QEvent *event) override;
     /* 鼠标点击事件 */
@@ -49,7 +49,7 @@ private:
 private:
     Ui::Warning *ui;
 
-    OneShadow* m_shadow = nullptr;
+    // OneShadow* m_shadow = nullptr;
     const int SHADOW_W = 16;                /* 阴影的大小 */
     bool m_isOk = false;