question.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef QUESTION_H
  2. #define QUESTION_H
  3. #include <QWidget>
  4. #include "changeQuestion.h"
  5. #include "paperDef.h"
  6. #include "CBaseWidget.h"
  7. #include "CHttpBll.h"
  8. #include <mutex>
  9. namespace Ui {
  10. class question;
  11. }
  12. class question : public QWidget
  13. {
  14. Q_OBJECT
  15. public:
  16. explicit question(CQuestionStruct &qs, int nOrder, int nTotalSubQuestion, QWidget *parent = nullptr);
  17. ~question();
  18. void setUI(const int nLeft, const int nTop, const int nWidth, const int nHeight);
  19. void showBtn(int nType);
  20. void setGroupInfo(QString sTitle, QString sProgress);
  21. void handinPaper();
  22. signals:
  23. void previousQuestion(int nOrder);
  24. void nextQuestion(int nOrder);
  25. void markedItem(bool bMarked, int nIndex);
  26. void questionAnswered(bool bAnswered, int nIndex);
  27. void uploadAnswer(int nIndex, __int64 timeStamp, QString sAnswer);
  28. private slots:
  29. void onPreviousQuestion();
  30. void onNextQuestion();
  31. void onMarkedItem(bool bMarked, int nOrder);
  32. void onQuestionAnswered(bool bAnswered, int nOrder);
  33. void onUploadAnswer(int nOrder, __int64 timeStamp, QString sAnswer);
  34. private:
  35. int initQuestionItem(CSubQuestionStruct &subQuestionItem);
  36. Ui::question *ui;
  37. changeQuestion *m_pWidgetChangeQuestion;
  38. CQuestionStruct &m_qs;
  39. int m_nOrder;
  40. int m_nTotalSubQuestion;
  41. int m_nListHeight;
  42. std::mutex m_uiMutex;
  43. };
  44. #endif // QUESTION_H