globaldef.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef _GLOBAL_DEF_H_
  2. #define _GLOBAL_DEF_H_
  3. #include <QString>
  4. #define CN(s) QString::fromLocal8Bit(s)
  5. #define S2QS(s) QString::fromStdString(s)
  6. #define KEY_ORIGINAL_IMAGE "original_image"
  7. #define ST_BG_COLOR QString("background-color: rgb(37, 37, 37);")
  8. #define ST_SOFTWARE_NAME CN("Pcba Analyser")
  9. #define ST_SOFTWARE_VERSION CN("V1.1")
  10. #define ST_CLIP_IMAGE 1
  11. #define QMESSAGEBOX_ERROR(msg) QMessageBox msgBox(QMessageBox::Icon::NoIcon, CN("´íÎó"), msg);\
  12. msgBox.setWindowIcon(QIcon(":/Assets/View/error.png"));\
  13. msgBox.exec();
  14. #define QMESSAGEBOX_WARN(msg) QMessageBox msgBox(QMessageBox::Icon::NoIcon, CN("¾¯¸æ"), msg);\
  15. msgBox.setWindowIcon(QIcon(":/Assets/View/warn.png"));\
  16. msgBox.exec();
  17. #define QMESSAGEBOX_INFO(msg) QMessageBox msgBox(QMessageBox::Icon::NoIcon, CN("Ìáʾ"), msg);\
  18. msgBox.setWindowIcon(QIcon(":/Assets/View/info.png"));\
  19. msgBox.exec();
  20. #define ST_CAMERA_PAR_BUTTON_QSS QString("QPushButton{background-color: rgb(8, 91, 82);font: 10pt \"΢ÈíÑźÚ\";border: 2px groove gray; border-radius: 5px;}\
  21. QPushButton:hover{background-color: rgb(17, 199, 178);font: 10pt ;border: 0px groove gray; border-radius: 5px;}\
  22. QPushButton:pressed{background-color: rgb(37, 37, 37); font: 10pt ;border: 2px groove gray; border-radius:5px;}\
  23. QPushButton:!enabled{background-color:rgb(37, 37, 37); font: 10pt \"΢ÈíÑźÚ\";border: 2px solid gray; border-radius: 5px;}")
  24. #define ST_MAIN_BUTTON_QSS(imgUrl) QString("QPushButton{background-color: rgb(8, 91, 82);font: 10pt \"΢ÈíÑźÚ\";border: 2px solid gray; border-radius: 5px;background-image:url(")+QString(imgUrl)+QString(");background-origin: content;background-position: left;background-repeat: no-repeat;padding-left:10px;text-align: right;padding-right:12px; }\
  25. QPushButton:hover{background-color: rgb(17, 199, 178);font: 10pt \"΢ÈíÑźÚ\";border: 0px solid gray; border-radius: 5px;}\
  26. QPushButton:pressed{background-color: rgb(37, 37, 37); font: 10pt \"΢ÈíÑźÚ\";border: 2px solid gray; border-radius: 5px;}\
  27. QPushButton:!enabled{background-color:rgb(37, 37, 37); font: 10pt \"΢ÈíÑźÚ\";border: 2px solid gray; border-radius: 5px;}")
  28. //
  29. //
  30. //#define ST_MYBUTTON_QSS QString("QPushButton{background-color: rgb(8, 91, 82);font: 15pt \"΢ÈíÑźÚ\";border: 0px groove gray; border-radius: 5px;}\
  31. //QPushButton:hover{background-color: rgb(17, 199, 178);font: 15pt \"΢ÈíÑźÚ\";border: 0px groove gray; border-radius: 5px;}\
  32. //QPushButton:pressed{background-color: rgb(37, 37, 37);font: 15pt \"΢ÈíÑźÚ\";border: 0px groove gray; border-radius:\5px;}")
  33. //
  34. //#define ST_CAM_CONN_QSS QString("QPushButton{background-color: rgb(8, 91, 82);color:rgb(0,255,0);font: 15pt \"΢ÈíÑźÚ\";border: 0px groove gray; border-radius: 5px;}\
  35. //QPushButton:hover{background-color: rgb(17, 199, 178);font: 15pt \"΢ÈíÑźÚ\";border: 0px groove gray; border-radius: 5px;}\
  36. //QPushButton:pressed{background-color: rgb(37, 37, 37);font: 15pt \"΢ÈíÑźÚ\";border: 0px groove gray; border-radius:\5px;}")
  37. //
  38. //#define ST_CAM_CLOSE_QSS QString("QPushButton{background-color: rgb(8, 91, 82);color:rgb(255,0,0);font: 15pt \"΢ÈíÑźÚ\";border: 0px groove gray; border-radius: 5px;}\
  39. //QPushButton:hover{background-color: rgb(17, 199, 178);font: 15pt \"΢ÈíÑźÚ\";border: 0px groove gray; border-radius: 5px;}\
  40. //QPushButton:pressed{background-color: rgb(37, 37, 37);font: 15pt \"΢ÈíÑźÚ\";border: 0px groove gray; border-radius:\5px;}")
  41. #define ST_DOUBLE_SPIN_BOX_QSS /*QString("QDoubleSpinBox::up-button{border:transparent;}\
  42. QDoubleSpinBox::down-button{border:transparent;}\
  43. QDoubleSpinBox::up-arrow{image:url(:/Assets/View/up.png);}\
  44. QDoubleSpinBox::down-arrow{image:url(:/Assets/View/down.png);}")*/
  45. #define ST_QTABLEWIDGET_QSS QString("QTableWidget{background-color:rgb(37, 37, 37);color:rgb(255,255,255);border:0px;font:10pt \"΢ÈíÑźÚ\";}\
  46. QTableWidget::item:hover{color:rgb(17, 199, 178);}\
  47. QTableWidget::item:selected{color:white;background:rgb(17, 199, 178);}")
  48. #define ST_QTABLEWIDGET_HEADER_QSS QString("QHeaderView::section{background-color:rgb(37, 37, 37);text-align:center;padding:3px;margin:0px;color:rgb(255,255,255);border:1px solid #242424;}\
  49. QHeaderView::section:selected{color:rgb(255,255,255);border:1px solid #242424;}")
  50. #define ST_QProgressBar_QSS QString("QProgressBar {\
  51. border: 1px solid grey;\
  52. border-radius: 5px;\
  53. text-align: center;\
  54. color:#ff0000;\
  55. }\
  56. QProgressBar::chunk {\
  57. background-color:rgb(17, 199, 178);\
  58. margin: 0.5px;\
  59. }")
  60. #endif