clNoticeDetail.cpp 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #include "clNoticeDetail.h"
  2. #include "ui_clNoticeDetail.h"
  3. #include "CAppInfo.h"
  4. clNoticeDetail::clNoticeDetail(CNoticeInfo ni, QWidget *parent) :
  5. QWidget(parent),
  6. ui(new Ui::clNoticeDetail), m_ni(ni)
  7. {
  8. ui->setupUi(this);
  9. setStyleSheet(g_appInfoPtr->m_sQssStr);
  10. }
  11. clNoticeDetail::~clNoticeDetail()
  12. {
  13. delete ui;
  14. }
  15. void clNoticeDetail::setUI(const int nLeft, const int nTop, const int nWidth, const int nHeight)
  16. {
  17. setGeometry(nLeft, nTop, nWidth, nHeight);
  18. ui->widget_offlineExam->setGeometry(0, 0, width(), height());
  19. ui->widget_op_top->setGeometry(0, 0, width(), g_appInfoPtr->m_fRate*72);
  20. ui->btn_gobackList->setGeometry(ui->widget_op_top->width() - g_appInfoPtr->m_fRate*30 - g_appInfoPtr->m_fRate*108,
  21. (ui->widget_op_top->height() - g_appInfoPtr->m_fRate*32)/2,
  22. g_appInfoPtr->m_fRate*108, g_appInfoPtr->m_fRate*32);
  23. ui->btn_gobackList->setIconSize(QSize(g_appInfoPtr->m_fRate*14, g_appInfoPtr->m_fRate*14));
  24. ui->btn_gobackList->setIcon(QIcon(":/images/icon-goback-list.png"));
  25. ui->widget_clnd_client->setGeometry(0, ui->widget_op_top->height(), width(), height() - ui->widget_op_top->height());
  26. ui->label_clnd_title->setText(m_ni.sTitle);
  27. ui->label_clnd_title->adjustSize();
  28. ui->label_clnd_title->setGeometry((ui->widget_clnd_client->width() - ui->label_clnd_title->width())/2,
  29. g_appInfoPtr->m_fRate*30, ui->label_clnd_title->width(), ui->label_clnd_title->height());
  30. ui->label_clnd_time->setText(m_ni.sPublishTime);
  31. ui->label_clnd_time->adjustSize();
  32. ui->label_clnd_time->setGeometry((ui->widget_clnd_client->width() - ui->label_clnd_time->width())/2,
  33. ui->label_clnd_title->y() + ui->label_clnd_title->height() + g_appInfoPtr->m_fRate*10, ui->label_clnd_time->width(), ui->label_clnd_time->height());
  34. ui->label_HLine->setGeometry(g_appInfoPtr->m_fRate*30, ui->label_clnd_time->y() + ui->label_clnd_time->height() + g_appInfoPtr->m_fRate*30,
  35. ui->widget_clnd_client->width() - g_appInfoPtr->m_fRate*30*2, g_appInfoPtr->m_fRate*1);
  36. ui->txtb_noticeContent->insertHtml(m_ni.sContent);
  37. ui->txtb_noticeContent->setGeometry(ui->label_HLine->x(), ui->label_HLine->y() + ui->label_HLine->height() + g_appInfoPtr->m_fRate*16,
  38. ui->label_HLine->width(), ui->widget_clnd_client->height() - ui->label_HLine->y() - g_appInfoPtr->m_fRate*(16 + 16 + 1));
  39. }
  40. void clNoticeDetail::on_btn_gobackList_clicked()
  41. {
  42. emit gobackNoticeList();
  43. }