From 58f497f3f174656bfbaa74ad6d7bdb64d3f9374b Mon Sep 17 00:00:00 2001 From: lm Date: Fri, 18 Feb 2011 12:20:38 +0100 Subject: [PATCH] Fixed initialization order of map widget --- src/ui/MapWidget.cc | 50 +++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/src/ui/MapWidget.cc b/src/ui/MapWidget.cc index 277f57150..9f9c09c10 100644 --- a/src/ui/MapWidget.cc +++ b/src/ui/MapWidget.cc @@ -28,13 +28,13 @@ MapWidget::MapWidget(QWidget *parent) : QWidget(parent), + mc(NULL), zoomLevel(0), uasIcons(), uasTrails(), mav(NULL), lastUpdate(0), initialized(false), - mc(NULL), m_ui(new Ui::MapWidget) { m_ui->setupUi(this); @@ -48,14 +48,6 @@ void MapWidget::init() QString buttonStyle("QAbstractButton { background-color: rgba(20, 20, 20, 45%); border-color: rgba(10, 10, 10, 50%)} QAbstractButton:checked { border: 2px solid #379AC3; }"); mc->setPen(QGC::colorCyan.darker(400)); - - - - - - - - waypointIsDrag = false; // Accept focus by clicking or keyboard @@ -220,6 +212,26 @@ void MapWidget::init() innerlayout->setRowStretch(1, 100); mc->setLayout(innerlayout); + // Configure the WP Path's pen + pointPen = new QPen(QColor(0, 255,0)); + pointPen->setWidth(3); + waypointPath = new qmapcontrol::LineString (wps, "Waypoint path", pointPen); + mc->layer("Waypoints")->addGeometry(waypointPath); + + //Camera Control + // CAMERA INDICATOR LAYER + // create a layer with the mapadapter and type GeometryLayer (for camera indicator) + camLayer = new qmapcontrol::GeometryLayer("Camera", mapadapter); + mc->addLayer(camLayer); + + //camLine = new qmapcontrol::LineString(camPoints,"Camera Eje", camBorderPen); + + drawCamBorder = false; + radioCamera = 10; + + // Done set state + initialized = true; + // Connect the required signals-slots connect(zoomin, SIGNAL(clicked(bool)), @@ -257,26 +269,6 @@ void MapWidget::init() connect(geomLayer, SIGNAL(geometryEndDrag(Geometry*, QPointF)), this, SLOT(captureGeometryEndDrag(Geometry*, QPointF))); - - // Configure the WP Path's pen - pointPen = new QPen(QColor(0, 255,0)); - pointPen->setWidth(3); - waypointPath = new qmapcontrol::LineString (wps, "Waypoint path", pointPen); - mc->layer("Waypoints")->addGeometry(waypointPath); - - //Camera Control - // CAMERA INDICATOR LAYER - // create a layer with the mapadapter and type GeometryLayer (for camera indicator) - camLayer = new qmapcontrol::GeometryLayer("Camera", mapadapter); - mc->addLayer(camLayer); - - //camLine = new qmapcontrol::LineString(camPoints,"Camera Eje", camBorderPen); - - drawCamBorder = false; - radioCamera = 10; - - // Done set state - initialized = true; } void MapWidget::goTo() -- 2.22.0