+ // Check if all annotations are of the same type (i.e. we can use one color)
+ // or if we should use a neutral color (i.e. gray)
+ bool single_format = true;
+ int format = annotations.front().format();
+
+ for (const Annotation &a : annotations)
+ if (a.format() != format) {
+ single_format = false;
+ break;
+ }
+
+ p.setPen((single_format ? OutlineColours[colour] : Qt::gray));
+ p.setBrush(QBrush((single_format ? Colours[colour] : Qt::gray),
+ Qt::Dense4Pattern));
+
+ p.drawConvexPolygon(pts, countof(pts));