From 4aad52f6f7e0cc9fe53b3b72af9ca65de1ffc716 Mon Sep 17 00:00:00 2001 From: Fredrik Arvidsson Date: Sat, 17 Aug 2013 23:17:06 +0200 Subject: [PATCH] OP-1071 Adds dashed and width functionality to circle. --- .../libs/opmapcontrol/src/mapwidget/waypointcircle.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointcircle.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointcircle.cpp index 735a5538e..0d1302f65 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointcircle.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/mapwidget/waypointcircle.cpp @@ -41,7 +41,7 @@ WayPointCircle::WayPointCircle(WayPointItem *center, WayPointItem *radius, bool } WayPointCircle::WayPointCircle(HomeItem *radius, WayPointItem *center, bool clockwise, MapGraphicItem *map, QColor color, bool dashed, int width) : my_center(center), - my_radius(radius), my_map(map), QGraphicsEllipseItem(map), myColor(color), myClockWise(clockwise) + my_radius(radius), my_map(map), QGraphicsEllipseItem(map), myColor(color), myClockWise(clockwise), dashed(dashed), width(width) { connect(radius, SIGNAL(homePositionChanged(internals::PointLatLng, float)), this, SLOT(refreshLocations())); connect(center, SIGNAL(localPositionChanged(QPointF)), this, SLOT(refreshLocations())); @@ -67,6 +67,14 @@ void WayPointCircle::paint(QPainter *painter, const QStyleOptionGraphicsItem *op p2 = QPointF(line.p1().x(), line.p1().y() - line.length()); QPen myPen = pen(); myPen.setColor(myColor); + if(width > 0) { + myPen.setWidth(width); + } + if(dashed){ + QVector dashes; + dashes << 4 << 8; + myPen.setDashPattern(dashes); + } qreal arrowSize = 10; painter->setPen(myPen); QBrush brush = painter->brush();