Changeset 5228 in ntrip
- Timestamp:
- Jun 16, 2013, 4:15:05 PM (11 years ago)
- Location:
- trunk/BNC/src/map
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/map/bncmapwin.cpp
r5216 r5228 62 62 _webView->show(); 63 63 64 // Test 65 // ---- 66 _mode = mode_ppp; 67 _testButton = new QPushButton(tr("Start Test")); 68 _testButton->setMaximumWidth(10*ww); 69 connect(_testButton, SIGNAL(clicked()), this, SLOT(slotTest())); 64 _statusLabel = new QLabel; 70 65 71 66 // Layout 72 67 // ------ 73 QHBoxLayout* buttonLayout = new QHBoxLayout; 74 buttonLayout->addWidget(_testButton); 68 69 QHBoxLayout* statusLayout = new QHBoxLayout; 70 statusLayout->addWidget(_statusLabel); 75 71 76 72 QVBoxLayout* mainLayout = new QVBoxLayout(this); 77 73 mainLayout->addWidget(_webView); 78 mainLayout->addLayout( buttonLayout);74 mainLayout->addLayout(statusLayout); 79 75 80 76 setLayout(mainLayout); … … 121 117 _currLon = lon; 122 118 QString location = QString("%1, %2").arg(_currLat,0,'f',8).arg(_currLon,0,'f',8); 119 _statusLabel->setText(location); 123 120 _webView->page()->mainFrame()->evaluateJavaScript(QString("gotoLocation( %1 )").arg(location)); 124 }125 126 //127 ////////////////////////////////////////////////////////////////////////////128 void bncMapWin::slotTest() {129 130 if (sender() == _testButton) {131 if (_mode == mode_ppp) {132 _mode = mode_test;133 _testButton->setText(tr("Stop Test"));134 }135 else {136 _mode = mode_ppp;137 _testButton->setText(tr("Start Test"));138 return;139 }140 }141 142 if (_mode == mode_test) {143 _currLat += 0.00001;144 _currLon += 0.00001;145 gotoLocation(_currLat, _currLon);146 QTimer::singleShot(100, this, SLOT(slotTest()));147 }148 121 } 149 122 -
trunk/BNC/src/map/bncmapwin.h
r5187 r5228 44 44 private slots: 45 45 void slotInitMap(bool isOk); 46 void slotTest();47 46 48 47 private: 49 enum e_mode {mode_test, mode_ppp};50 48 void loadHtmlPage(); 51 49 void gotoLocation(double lat, double lon); 52 QWebView* _webView; 53 QPushButton* _testButton; 54 double _currLat; 55 double _currLon; 56 e_mode _mode; 50 QWebView* _webView; 51 QLabel* _statusLabel; 52 double _currLat; 53 double _currLon; 57 54 }; 58 55
Note:
See TracChangeset
for help on using the changeset viewer.