Engauge Digitizer  2
NonPdfFrameHandle.h
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #ifndef NON_PDF_FRAME_HANDLE_H
8 #define NON_PDF_FRAME_HANDLE_H
9 
10 #include <QGraphicsRectItem>
11 
12 class NonPdfCropping;
13 class QGraphicsScene;
14 class QGraphicsView;
15 class QPointF;
16 class QRectF;
17 
19 class NonPdfFrameHandle : public QGraphicsRectItem
20 {
21 public:
23  NonPdfFrameHandle(QGraphicsScene &scene,
24  QGraphicsView &view,
25  const QPointF &pointReference,
26  int orientationFlags,
27  NonPdfCropping &nonPdfCropping,
28  int zValue);
29 
31  virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
32 
34  virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
35 
37  void setDisableEventsWhileMovingAutomatically (bool disable);
38 
39 private:
41 
42  NonPdfCropping &m_nonPdfCropping;
43  int m_orientationFlags; // From PdfCropping constants
44 
45  bool m_disableEventsWhileMovingAutomatically;
46  QGraphicsScene &m_scene;
47  QGraphicsView &m_view;
48 };
49 
50 #endif // NON_PDF_FRAME_HANDLE_H
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Override the paint method so the dashed-border-when-selected can be removed.
This class shows a frame around the selected portion of the import preview window.
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value)
Intercept the drags and process them, which is the whole point of handles.
This class acts as a single handle for the NonPdfCropping class.
void setDisableEventsWhileMovingAutomatically(bool disable)
Temporarily disable event handling so code can move this object without triggering a cascade of event...