#include #include #include #include #include #include #include #include #include #include #include "bncmap.h" // Constructor ///////////////////////////////////////////////////////////////////////////// t_bncMap::t_bncMap(QWidget* parent) : QDialog(parent) { _mapPlot = new QwtPlot(); (void)new QwtPlotPanner(_mapPlot->canvas()); (void)new QwtPlotMagnifier(_mapPlot->canvas()); _mapPlot->canvas()->setFocusPolicy(Qt::WheelFocus); QwtPlotSvgItem* mapItem = new QwtPlotSvgItem(); mapItem->loadFile(QRectF(-180.0, -90.0, 360.0, 180.0), ":world.svg"); mapItem->attach(_mapPlot); QVBoxLayout* mainLayout = new QVBoxLayout(this); mainLayout->addWidget(_mapPlot); _mapPlot->replot(); } // Destructor ///////////////////////////////////////////////////////////////////////////// t_bncMap::~t_bncMap() { delete _mapPlot; } // ///////////////////////////////////////////////////////////////////////////// void t_bncMap::slotNewPoint(QPointF point, QString name, QPen, double) { QwtPlotMarker* marker = new QwtPlotMarker(); marker->setValue(point.x(), point.y()); marker->setLabel(QwtText(name)); marker->attach(_mapPlot); }