Changeset 4626 in ntrip for trunk/BNC/src/bncmap_svg.cpp
- Timestamp:
- Sep 1, 2012, 2:02:13 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncmap_svg.cpp
r4622 r4626 16 16 // Constructor 17 17 ///////////////////////////////////////////////////////////////////////////// 18 bncMap::bncMap(QWidget* parent) : QDialog(parent) {18 t_bncMap::t_bncMap(QWidget* parent) : QDialog(parent) { 19 19 20 QwtPlot* plot = new QwtPlot();20 _mapPlot = new QwtPlot(); 21 21 22 (void)new QwtPlotPanner( plot->canvas());23 (void)new QwtPlotMagnifier( plot->canvas());22 (void)new QwtPlotPanner(_mapPlot->canvas()); 23 (void)new QwtPlotMagnifier(_mapPlot->canvas()); 24 24 25 plot->canvas()->setFocusPolicy(Qt::WheelFocus);25 _mapPlot->canvas()->setFocusPolicy(Qt::WheelFocus); 26 26 27 QRectF rect(-180.0, -90.0, 360.0, 180.0); 28 29 QwtPlotSvgItem* map = new QwtPlotSvgItem(); 30 map->loadFile(rect, ":world.svg"); 31 map->attach(plot); 32 33 //// beg test 34 for (int ii = -180; ii <= 180; ii += 60) { 35 for (int jj = -80; jj <= 80; jj += 40) { 36 QwtPlotMarker* marker = new QwtPlotMarker(); 37 marker->setValue(ii,jj); 38 marker->setLabel(QwtText("TXT")); 39 marker->setItemAttribute(QwtPlotItem::AutoScale, false); 40 marker->attach(plot); 41 } 42 } 43 //// end test 27 QwtPlotSvgItem* mapItem = new QwtPlotSvgItem(); 28 mapItem->loadFile(QRectF(-180.0, -90.0, 360.0, 180.0), ":world.svg"); 29 mapItem->attach(_mapPlot); 44 30 45 31 QVBoxLayout* mainLayout = new QVBoxLayout(this); 46 mainLayout->addWidget( plot);32 mainLayout->addWidget(_mapPlot); 47 33 48 plot->replot();34 _mapPlot->replot(); 49 35 } 50 36 51 37 // Destructor 52 38 ///////////////////////////////////////////////////////////////////////////// 53 bncMap::~bncMap(){ 39 t_bncMap::~t_bncMap() { 40 delete _mapPlot; 54 41 } 42 43 // 44 ///////////////////////////////////////////////////////////////////////////// 45 void t_bncMap::slotNewPoint(QPointF point, QString name, QPen, double) { 46 QwtPlotMarker* marker = new QwtPlotMarker(); 47 marker->setValue(point.x(), point.y()); 48 marker->setLabel(QwtText(name)); 49 marker->attach(_mapPlot); 50 } 51 52 53
Note:
See TracChangeset
for help on using the changeset viewer.