10#include <QGraphicsScene>
11#include <QGraphicsView>
13#include <QStyleOptionGraphicsItem>
25 m_disableEventsWhileMovingAutomatically (
false),
43 setFlags (QGraphicsItem::ItemIsMovable |
44 QGraphicsItem::ItemIsSelectable |
45 QGraphicsItem::ItemSendsScenePositionChanges);
88 boundingRect().size().
height());
115 if (!m_disableEventsWhileMovingAutomatically) {
147 m_disableEventsWhileMovingAutomatically =
disable;
const int INNER_RADIUS_MIN
const double HANDLE_SIZE_AS_FRACTION_OF_WINDOW_SIZE
const double HANDLE_SIZE_AS_FRACTION_OF_WINDOW_SIZE
This class shows a frame around the selected portion of the pdf import preview window.
void moveBL(const QPointF &newPos, const QPointF &oldPos)
Bottom left corner handle was moved.
static const int PDF_CROPPING_LEFT
Bit flag when handle is aligned with left edge at reference point.
static const int PDF_CROPPING_BOTTOM
Bit flag when handle is aligned with bottom edge at reference point.
QSize windowSize() const
Size of window in scene coordinates.
static const int PDF_CROPPING_TOP
Bit flag when handle is aligned with top edge at reference point.
void moveTL(const QPointF &newPos, const QPointF &oldPos)
Top left corner handle was moved.
void moveTR(const QPointF &newPos, const QPointF &oldPos)
Top right corner handle was moved.
void moveBR(const QPointF &newPos, const QPointF &oldPos)
Bottom right corner handle was moved.
static const int PDF_CROPPING_RIGHT
Bit flag when handle is aligned with right edge at reference point.
PdfFrameHandle(QGraphicsScene &scene, QGraphicsView &view, const QPointF &pointReference, int orientationFlags, PdfCropping &pdfCropping, int zValue)
Single constructor.
void setDisableEventsWhileMovingAutomatically(bool disable)
Temporarily disable event handling so code can move this object without triggering a cascade of event...
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value)
Intercept the drags and process them, which is the whole point of handles.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Override the paint method so the dashed-border-when-selected can be removed.