7 #include "CursorFactory.h" 8 #include "CursorSize.h" 9 #include "DocumentModelDigitizeCurve.h" 23 int size = CursorSizeToPixels (modelDigitizeCurve.
cursorSize());
24 int halfSize = size / 2;
26 int halfLineWidth = lineWidth / 2;
31 return QCursor (Qt::CrossCursor);
36 const int BACKGROUND_COLOR = Qt::white, FOREGROUND_COLOR = Qt::black;
40 QPixmap picMask (size,
42 QPainter picMaskPaint (&picMask);
43 picMask.fill (QColor (BACKGROUND_COLOR));
45 QPen pen (QBrush (FOREGROUND_COLOR),
47 picMaskPaint.setPen (pen);
49 picMaskPaint.drawLine (QPointF (halfSize,
50 halfSize - innerRadius - halfLineWidth),
53 picMaskPaint.drawLine (QPointF (halfSize - innerRadius - halfLineWidth,
57 picMaskPaint.drawLine (QPointF (halfSize,
58 halfSize + innerRadius + halfLineWidth),
60 size - 1 - lineWidth));
61 picMaskPaint.drawLine (QPointF (halfSize + innerRadius + halfLineWidth,
63 QPointF (size - 1 - lineWidth,
68 pic.fill (QColor (FOREGROUND_COLOR));
70 return QCursor (pic.createMaskFromColor(QColor (BACKGROUND_COLOR)),
71 picMask.createMaskFromColor(QColor (BACKGROUND_COLOR)));
CursorFactory()
Single constructor.
CursorSize cursorSize() const
Get method for cursor size.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
int cursorInnerRadius() const
Get method for cursor inner radius.
bool cursorStandardCross() const
Get method for cursor type.
int cursorLineWidth() const
Get method for cursor line width.
QCursor generate(const DocumentModelDigitizeCurve &modelDigitizeCurve) const
Factory method to generate standard or custom cursor.