1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #ifndef PAPEREDITHANDLE_H
- #define PAPEREDITHANDLE_H
- #include <QWidget>
- #include "ui_paperedithandle.h"
- #include <QStack>
- #include <map>
- #include "../SmartEvaluationLogic/ScanDll.h"
- class CPaperEditHandle : public QWidget
- {
- Q_OBJECT
- public:
- CPaperEditHandle(QWidget *parent = 0);
- ~CPaperEditHandle();
- enum MouseStatus
- {
- Mouse_Normal,
- Mouse_Drag,
- Mouse_Pen,
- Mouse_Line,
- Mouse_Eraser,
- Mouse_Cut,
- Mouse_Cuting,
- Mouse_Locate,
- };
- void setCurrentBatch(batch_info* batchInfo, vector<paper_info>* papers);
- void GetCurrentPaper(paper_info& paperInfo);
- private slots:
- void slot_onButtonClick();
- private:
- virtual void resizeEvent(QResizeEvent* event);
- virtual void mouseMoveEvent(QMouseEvent* event);
- virtual void mousePressEvent(QMouseEvent* event);
- virtual void mouseReleaseEvent(QMouseEvent* event);
- virtual void paintEvent(QPaintEvent *);
- virtual void wheelEvent(QWheelEvent *event);
- void ClickDrag();
- void ClickRoomin();
- void ClickRoomout();
- void ClickRotate90();
- void ClickRotateN90();
- void ClickLocate(QObject* sender);
- void ClickEraser(QObject* sender);
- void ClickSwitchPage();
- void ClickUndo();
- void ClickRestore();
- QPoint PointSwitchToImg(QPoint sPoint);
- QRect RectSwitchImg(QRect sRect);
- void SaveTempImg();
- void CalcRoom();
- private:
- Ui::CPaperEditHandle ui;
- QPoint m_offset;
- float m_room;
- QImage m_bgimage;
- //QStack<QImage> m_stackImage;
- MouseStatus m_mousestatus;
- map<int, QStack<string>> m_mapStackPage;
- int m_nCurrentPage; // 当前一张试卷中的第几页
- int m_eraserW;
- int m_eraserH;
- int m_locateW;
- int m_locateH;
- bool m_bpressed;
- QPoint m_startPoint;
- QPoint m_endPoint;
- batch_info* m_pBatchInfo;
- vector<paper_info>* m_pPapers;
- int m_nCurrentPaper; // 当前第几张试卷
- bool m_bLocateChecked; // 定位点选中
- bool m_bEraserChecked; // 橡皮擦
- map<QObject *, QPoint> m_locatePointMap;
- };
- #endif // PAPEREDITHANDLE_H
|