MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lgrAnnotationPaint.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2026 MAK Technologies, Inc
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
9 #ifndef lgrAnnotationPaint_H_
10 #define lgrAnnotationPaint_H_
11 
12 #include <QColor>
13 #include <QRectF>
14 #include <Qt>
15 
16 class QPainter;
17 
18 namespace MAKLogger
19 {
20 namespace AnnotationPaint
21 {
22  const int kSwatchWidth = 24;
23  const int kSwatchHeight = 16;
25  const qreal kSwatchRadius = 4.0;
26 
28  qreal snap(qreal value,qreal dpr);
29 
31  QRectF snapRect(const QRectF& rect,qreal dpr);
32 
34  qreal strokeWidth(int logicalWidth,qreal dpr);
35 
37  void strokeRoundedRect(QPainter& painter,const QRectF& rect,qreal radius,
38  const QColor& color,int logicalWidth,Qt::PenStyle style = Qt::SolidLine);
39 
42  void paintSwatch(QPainter& painter,const QRectF& rect,qreal radius,
43  const QColor& color,const QColor& outline,int outlineWidth);
44 
46  void drawCheck(QPainter& painter,const QRectF& box,const QColor& color,qreal strokeWidth);
47 }
48 }
49 
50 #endif
QRectF snapRect(const QRectF &rect, qreal dpr)
rect with every edge on a whole device pixel.
const int kSwatchWidth
Definition: lgrAnnotationPaint.h:22
const int kSwatchHeight
Definition: lgrAnnotationPaint.h:23
qreal snap(qreal value, qreal dpr)
value rounded to a whole device pixel.
void drawCheck(QPainter &painter, const QRectF &box, const QColor &color, qreal strokeWidth)
Lucide &quot;check&quot; (24-unit grid) scaled into box.
void strokeRoundedRect(QPainter &painter, const QRectF &rect, qreal radius, const QColor &color, int logicalWidth, Qt::PenStyle style=Qt::SolidLine)
Rounded outline drawn inside rect, snapped to whole device pixels.
void paintSwatch(QPainter &painter, const QRectF &rect, qreal radius, const QColor &color, const QColor &outline, int outlineWidth)
Rounded swatch with a snapped outline inside rect; an invalid color draws an empty dashed swatch...
qreal strokeWidth(int logicalWidth, qreal dpr)
logicalWidth rounded to whole device pixels, at least one.
const qreal kSwatchRadius
radius-sm
Definition: lgrAnnotationPaint.h:25

Document ID: Generated on Tue Nov 17 15:25:07 EST 2026 from SVN revision 298446
Copyright © 2026 MAK Technologies. All Rights Reserved (www.mak.com)