questionOption.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef QUESTIONOPTION_H
  2. #define QUESTIONOPTION_H
  3. #include <QWidget>
  4. #include "json/json.h"
  5. #include "CBaseWidget.h"
  6. namespace Ui {
  7. class questionOption;
  8. }
  9. class questionOption : public CBaseWidget
  10. {
  11. Q_OBJECT
  12. public:
  13. explicit questionOption(int nOrder, Json::Value jOption, int nLimitedPlayTimes, QWidget *parent = nullptr);
  14. ~questionOption();
  15. int setUI(const int nWidth);
  16. int widgetType();
  17. void setMultiChoice(bool bIsMultiChoice);
  18. void setAnswered(bool bAnswered);
  19. void setChecked(bool bChecked);
  20. bool checked();
  21. int optionMumber();
  22. signals:
  23. void answerChanged(int); //单选
  24. void answered(); //单选
  25. void cancelAnswered(); //单选
  26. void mutiAnswerChanged();
  27. void audioPlayCountChange();
  28. private slots:
  29. void on_chkb_option_clicked();
  30. private:
  31. void initOption();
  32. void setCheckStyle();
  33. Ui::questionOption *ui;
  34. Json::Value m_jOption;
  35. int m_nOrder;
  36. int m_nLimitedPlayTimes;
  37. int m_nListHeight;
  38. bool m_bHasAns;
  39. bool m_bIsMultiChoice;
  40. };
  41. #endif // QUESTIONOPTION_H