clOperation.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef CLOPERATION_H
  2. #define CLOPERATION_H
  3. #include <QWidget>
  4. namespace Ui {
  5. class clOperation;
  6. }
  7. enum class CL_OPERATION_TYPE
  8. {
  9. cot_online_exam = 1,
  10. cot_online_finish_exam,
  11. cot_online_homework,
  12. cot_online_practice,
  13. cot_online_practice_result,
  14. cot_offline_init_exam,
  15. cot_offline_exam,
  16. cot_offline_status_null,
  17. cot_offline_status_download,
  18. };
  19. class clOperation : public QWidget
  20. {
  21. Q_OBJECT
  22. signals:
  23. void showObjectiveScore(CL_OPERATION_TYPE cot, int nRow);
  24. void hideObjectiveScore(CL_OPERATION_TYPE cot, int nRow);
  25. void enterExam(CL_OPERATION_TYPE cot, int nRow);
  26. void viewPracticeDetail(int nRow);
  27. void viewPracticePaper(int nRow);
  28. void offlineExamStart(int nRow);
  29. void viewOfflinePaper(int nRow);
  30. void downloadOfflinePaper(int nRow);
  31. void uploadOfflineAnswer(int nRow);
  32. void downloadOfflineAnswer(int nRow);
  33. public:
  34. explicit clOperation(const int nRow, QWidget *parent = nullptr);
  35. ~clOperation();
  36. void setUI(const int nWidth, const int nHeight, CL_OPERATION_TYPE cot);
  37. void setOperationType(CL_OPERATION_TYPE cot);
  38. void setBtn1Enable(bool bEnable);
  39. void setBtn2Enable(bool bEnable);
  40. private slots:
  41. void on_btn1_clicked();
  42. void on_btn2_clicked();
  43. void on_btn3_clicked();
  44. void on_btn4_clicked();
  45. private:
  46. bool eventFilter(QObject *obj, QEvent *ev);
  47. Ui::clOperation *ui;
  48. CL_OPERATION_TYPE m_operationType;
  49. int m_nRow;
  50. };
  51. #endif // CLOPERATION_H