1 #include "CursorFactory.h"
2 #include "CursorSize.h"
3 #include "DocumentModelDigitizeCurve.h"
17 int size = CursorSizeToPixels (modelDigitizeCurve.
cursorSize());
18 int halfSize = size / 2;
20 int halfLineWidth = lineWidth / 2;
25 return QCursor (Qt::CrossCursor);
30 const int BACKGROUND_COLOR = Qt::white, FOREGROUND_COLOR = Qt::black;
34 QPixmap picMask (size,
36 QPainter picMaskPaint (&picMask);
37 picMask.fill (QColor (BACKGROUND_COLOR));
39 QPen pen (QBrush (FOREGROUND_COLOR),
41 picMaskPaint.setPen (pen);
43 picMaskPaint.drawLine (QPointF (halfSize,
44 halfSize - innerRadius - halfLineWidth),
47 picMaskPaint.drawLine (QPointF (halfSize - innerRadius - halfLineWidth,
51 picMaskPaint.drawLine (QPointF (halfSize,
52 halfSize + innerRadius + halfLineWidth),
54 size - 1 - lineWidth));
55 picMaskPaint.drawLine (QPointF (halfSize + innerRadius + halfLineWidth,
57 QPointF (size - 1 - lineWidth,
62 pic.fill (QColor (FOREGROUND_COLOR));
64 return QCursor (pic.createMaskFromColor(QColor (BACKGROUND_COLOR)),
65 picMask.createMaskFromColor(QColor (BACKGROUND_COLOR)));
int cursorLineWidth() const
Get method for cursor line width.
CursorFactory()
Single constructor.
bool cursorStandardCross() const
Get method for cursor type.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
int cursorInnerRadius() const
Get method for cursor inner radius.
CursorSize cursorSize() const
Get method for cursor size.
QCursor generate(const DocumentModelDigitizeCurve &modelDigitizeCurve) const
Factory method to generate standard or custom cursor.