etWhetherEnvTest.cpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include "etWhetherEnvTest.h"
  2. #include "ui_etWhetherEnvTest.h"
  3. #include <QDesktopWidget>
  4. #include "CAppInfo.h"
  5. etWhetherEnvTest::etWhetherEnvTest(QWidget *parent) :
  6. QWidget(parent),
  7. ui(new Ui::etWhetherEnvTest)
  8. {
  9. ui->setupUi(this);
  10. setWindowFlags(Qt::FramelessWindowHint);
  11. setStyleSheet(g_appInfoPtr->m_sQssStr);
  12. initUI();
  13. }
  14. etWhetherEnvTest::~etWhetherEnvTest()
  15. {
  16. delete ui;
  17. }
  18. void etWhetherEnvTest::initUI()
  19. {
  20. QDesktopWidget *dekwiget = QApplication::desktop();
  21. setGeometry(0, 0, dekwiget->width(), dekwiget->height());
  22. ui->widget_mask->setGeometry(0, 0, dekwiget->width(), dekwiget->height());
  23. ui->widget_wcw_BG->setGeometry((width() - g_appInfoPtr->m_fRate*420)/2, (height() - g_appInfoPtr->m_fRate*212)/2,
  24. g_appInfoPtr->m_fRate*420, g_appInfoPtr->m_fRate*212);
  25. ui->label_wcw_icon->setGeometry(g_appInfoPtr->m_fRate*30, g_appInfoPtr->m_fRate*30,
  26. g_appInfoPtr->m_fRate*40, g_appInfoPtr->m_fRate*40);
  27. ui->label_wec_tips->adjustSize();
  28. ui->label_wec_tips->setGeometry(ui->label_wcw_icon->x() + ui->label_wcw_icon->width() + g_appInfoPtr->m_fRate*20,
  29. ui->label_wcw_icon->y(), ui->label_wec_tips->width(), ui->label_wec_tips->height());
  30. ui->label_wec_content->setLineWidth(ui->widget_wcw_BG->width() - g_appInfoPtr->m_fRate*(30 + 20) - ui->label_wcw_icon->x() - ui->label_wcw_icon->width());
  31. ui->label_wec_content->adjustSize();
  32. ui->label_wec_content->setGeometry(ui->label_wec_tips->x(), ui->label_wec_tips->y() + ui->label_wec_tips->height() + g_appInfoPtr->m_fRate*8,
  33. ui->label_wec_content->width(), ui->label_wec_content->height());
  34. ui->btn_startEnvTest->setGeometry(ui->widget_wcw_BG->width() - g_appInfoPtr->m_fRate*(20 + 80), ui->widget_wcw_BG->height() - g_appInfoPtr->m_fRate*(20 + 30),
  35. g_appInfoPtr->m_fRate*80, g_appInfoPtr->m_fRate*30);
  36. ui->btn_skipEnvTest->setGeometry(ui->btn_startEnvTest->x() - ui->btn_startEnvTest->width() - g_appInfoPtr->m_fRate*10,
  37. ui->btn_startEnvTest->y(), ui->btn_startEnvTest->width(), ui->btn_startEnvTest->height());
  38. }
  39. void etWhetherEnvTest::on_btn_skipEnvTest_clicked()
  40. {
  41. emit skipEnvTest();
  42. }
  43. void etWhetherEnvTest::on_btn_startEnvTest_clicked()
  44. {
  45. emit envTest();
  46. }