Changeset 4626 in ntrip
- Timestamp:
- Sep 1, 2012, 2:02:13 PM (12 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncmap.h
r4624 r4626 5 5 #include <QtGui> 6 6 7 class bncMap : public QDialog { 7 class QwtPlot; 8 9 class t_bncMap : public QDialog { 8 10 Q_OBJECT 9 11 10 12 public: 11 bncMap(QWidget* parent = 0);12 ~ bncMap();13 t_bncMap(QWidget* parent = 0); 14 ~t_bncMap(); 13 15 14 16 public slots: 17 void slotNewPoint(QPointF, QString, QPen, double); 15 18 16 19 private: 20 QwtPlot* _mapPlot; 17 21 }; 18 22 -
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 -
trunk/BNC/src/bnctabledlg.cpp
r4278 r4626 324 324 void bncTableDlg::slotShowMap() { 325 325 326 bncMap* winMap = newbncMap(this);327 winMap->setGeometry( x(), int(y()+height()*1.3), 880, 440 );326 t_bncMap* bncMap = new t_bncMap(this); 327 bncMap->setGeometry( x(), int(y()+height()*1.3), 880, 440 ); 328 328 329 329 connect(this, SIGNAL(newPoint(QPointF, QString, QPen, double)), 330 winMap, SLOT(slotNewPoint(QPointF, QString, QPen, double))); 331 332 connect(this, SIGNAL(fitMap()), 333 winMap, SLOT(slotFitMap() )); 334 335 connect(this, SIGNAL(fitFont()), 336 winMap, SLOT(slotFitFont() )); 330 bncMap, SLOT(slotNewPoint(QPointF, QString, QPen, double))); 337 331 338 332 _buttonMap->setEnabled(false); 339 333 showSourceTable(); 340 winMap->exec();334 bncMap->exec(); 341 335 _buttonMap->setEnabled(true); 342 336 343 337 disconnect(this, SIGNAL(newPoint(QPointF, QString, QPen, double)), 344 winMap, SLOT(slotNewPoint(QPointF, QString, QPen, double)));338 bncMap, SLOT(slotNewPoint(QPointF, QString, QPen, double))); 345 339 346 disconnect(this, SIGNAL(fitMap()), 347 winMap, SLOT(slotFitMap() )); 348 349 disconnect(this, SIGNAL(fitFont()), 350 winMap, SLOT(slotFitFont() )); 351 352 delete winMap; 340 delete bncMap; 353 341 } 354 342
Note:
See TracChangeset
for help on using the changeset viewer.