qhandlershibieyichang.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef QHANDLERSHIBIEYICHANG_H
  2. #define QHANDLERSHIBIEYICHANG_H
  3. #include <QWidget>
  4. #include "ui_qhandlershibieyichang.h"
  5. #include <QUndoStack>
  6. #include <vector>
  7. #include <QUndoCommand>
  8. struct PAGE_MARK_INFO{
  9. int mark_order[3];
  10. int mark_xiangxian[3];
  11. PAGE_MARK_INFO& operator=(const PAGE_MARK_INFO& page_mark_info){
  12. memcpy(this,&page_mark_info,sizeof(PAGE_MARK_INFO));
  13. return *this;
  14. }
  15. };
  16. enum CHANGE_TYPE{PAGE_ORDER,PAGE_MARK};
  17. class QHandlerShibieyichang : public QWidget
  18. {
  19. Q_OBJECT
  20. public:
  21. friend class QMyCommand;
  22. public:
  23. QHandlerShibieyichang(QWidget *parent = 0);
  24. ~QHandlerShibieyichang();
  25. void setPaperInfo( int paper_id);
  26. void getDefaultMarkInfo( PAGE_MARK_INFO &markinfo, int muban_img_cols,int muban_img_rows,int shijuan_img_cols,int shijuan_img_rows );
  27. virtual void resizeEvent( QResizeEvent * evt);
  28. void updateGeometrys();
  29. public slots:
  30. void switchPageHandler();
  31. void showPage();
  32. void hulueClickedHandler();
  33. void shibieClickedHandler();
  34. void xuanzhuanClickedHandler();
  35. void tool_clickedHander();
  36. void prePageClickedHandler();
  37. void nextPageClickedHandler();
  38. Q_SIGNALS:
  39. void handleCompleted(int paper_id);
  40. void handleCompletedCover(int paper_id, int covered_id);
  41. public:
  42. virtual bool eventFilter( QObject *o, QEvent * e);
  43. void OnDoFinish();//完成了,要保存图像
  44. bool IsEdited();
  45. private:
  46. Ui::QHandlerShibieyichang ui;
  47. int paper_id;
  48. std::vector<PAGE_MARK_INFO> page_mark_info;
  49. std::vector<int> schema_page;
  50. int m_currentPageIndex;
  51. int m_muban_count;
  52. int m_xiangxian;
  53. bool m_tuoyi;
  54. bool m_bEdited;//是否拖动(编辑)过
  55. };
  56. #endif // QHANDLERSHIBIEYICHANG_H