You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

654 lines
17 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. *
  3. * This file is part of QMapControl,
  4. * an open-source cross-platform map widget
  5. *
  6. * Copyright (C) 2007 - 2008 Kai Winter
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Lesser General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public License
  19. * along with QMapControl. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. * Contact e-mail: kaiwinter@gmx.de
  22. * Program URL : http://qmapcontrol.sourceforge.net/
  23. *
  24. */
  25. #include "mapcontrol.h"
  26. #include <QtCore/QTimer>
  27. MapControl::MapControl (QWidget * parent, Qt::WindowFlags windowFlags)
  28. : QFrame( parent, windowFlags ),
  29. m_layermanager(0),
  30. m_imagemanager(0),
  31. size(100,100),
  32. mouse_wheel_events(true),
  33. mousepressed(false),
  34. mymousemode(Panning),
  35. scaleVisible(false),
  36. crosshairsVisible(true),
  37. m_loadingFlag(false),
  38. steps(0),
  39. m_doubleBuffer(0)
  40. {
  41. __init();
  42. }
  43. MapControl::MapControl(QSize size, MouseMode mousemode, bool showScale, bool showCrosshairs, QWidget * parent, Qt::WindowFlags windowFlags)
  44. : QFrame( parent, windowFlags ),
  45. m_layermanager(0),
  46. m_imagemanager(0),
  47. size(size),
  48. mouse_wheel_events(true),
  49. mousepressed(false),
  50. mymousemode(mousemode),
  51. scaleVisible(showScale),
  52. crosshairsVisible(showCrosshairs),
  53. m_loadingFlag(false),
  54. steps(0),
  55. m_doubleBuffer(0)
  56. {
  57. __init();
  58. }
  59. MapControl::~MapControl()
  60. {
  61. if ( m_layermanager )
  62. {
  63. m_layermanager->deleteLater();
  64. m_layermanager = 0;
  65. }
  66. if ( m_imagemanager )
  67. {
  68. // m_imagemanager->deleteLater();
  69. m_imagemanager = 0;
  70. }
  71. }
  72. void MapControl::__init()
  73. {
  74. m_layermanager = new LayerManager(this, size);
  75. m_imagemanager = new ImageManager(this);
  76. screen_middle = QPoint(size.width()/2, size.height()/2);
  77. mousepressed = false;
  78. // connect(m_imagemanager, SIGNAL(imageReceived()),
  79. // this, SLOT(updateRequestNew()));
  80. //connect(m_imagemanager, SIGNAL(loadingFinished()),
  81. // this, SLOT(loadingFinished()));
  82. m_imagemanager->setCacheDir(QDir("data/mapcache"), 250);
  83. this->setMaximumSize(size.width()+1, size.height()+1);
  84. mouse_wheel_events = true;
  85. }
  86. void MapControl::enableMouseWheelEvents( bool enabled )
  87. {
  88. mouse_wheel_events = enabled;
  89. }
  90. bool MapControl::mouseWheelEventsEnabled()
  91. {
  92. return mouse_wheel_events;
  93. }
  94. QPointF MapControl::currentCoordinate() const
  95. {
  96. return m_layermanager->currentCoordinate();
  97. }
  98. Layer* MapControl::layer(const QString& layername) const
  99. {
  100. return m_layermanager->layer(layername);
  101. }
  102. QList<QString> MapControl::layers() const
  103. {
  104. return m_layermanager->layers();
  105. }
  106. int MapControl::numberOfLayers() const
  107. {
  108. return m_layermanager->layers().size();
  109. }
  110. void MapControl::followGeometry(const Geometry* geom) const
  111. {
  112. if ( geom == 0 )
  113. {
  114. return;
  115. }
  116. //ensures only one signal is ever connected
  117. stopFollowing(geom);
  118. connect(geom, SIGNAL(positionChanged(Geometry*)), this, SLOT(positionChanged(Geometry*)));
  119. }
  120. void MapControl::positionChanged(Geometry* geom)
  121. {
  122. if ( !m_layermanager->layer() || !m_layermanager->layer()->mapadapter() )
  123. {
  124. qDebug() << "MapControl::positionChanged() - no layers configured";
  125. return;
  126. }
  127. mapPoint* point = dynamic_cast<mapPoint*>(geom);
  128. if (point!=0)
  129. {
  130. QPoint start = m_layermanager->layer()->mapadapter()->coordinateToDisplay(currentCoordinate());
  131. QPoint dest = m_layermanager->layer()->mapadapter()->coordinateToDisplay(point->coordinate());
  132. QPoint step = (dest-start);
  133. m_layermanager->scrollView(step);
  134. updateRequestNew();
  135. }
  136. }
  137. void MapControl::moveTo(QPointF coordinate)
  138. {
  139. target = coordinate;
  140. steps = 25;
  141. if (moveMutex.tryLock())
  142. {
  143. QTimer::singleShot(40, this, SLOT(tick()));
  144. }
  145. else
  146. {
  147. // stopMove(coordinate);
  148. moveMutex.unlock();
  149. }
  150. }
  151. void MapControl::tick()
  152. {
  153. if ( !m_layermanager->layer() || !m_layermanager->layer()->mapadapter() )
  154. {
  155. qDebug() << "MapControl::tick() - no layers configured";
  156. return;
  157. }
  158. QPoint start = m_layermanager->layer()->mapadapter()->coordinateToDisplay(currentCoordinate());
  159. QPoint dest = m_layermanager->layer()->mapadapter()->coordinateToDisplay(target);
  160. QPoint step = (dest-start)/steps;
  161. m_layermanager->scrollView(step);
  162. update();
  163. m_layermanager->updateRequest();
  164. steps--;
  165. if (steps>0)
  166. {
  167. QTimer::singleShot(50, this, SLOT(tick()));
  168. }
  169. else
  170. {
  171. moveMutex.unlock();
  172. }
  173. }
  174. void MapControl::paintEvent(QPaintEvent* evnt)
  175. {
  176. Q_UNUSED(evnt);
  177. if ( m_doubleBuffer == 0 )
  178. {
  179. m_doubleBuffer = new QPixmap(width(), height());
  180. }
  181. //check for resize change
  182. else if ( m_doubleBuffer->width() != width() || m_doubleBuffer->height() != height() )
  183. {
  184. delete m_doubleBuffer;
  185. m_doubleBuffer = new QPixmap(width(), height());
  186. }
  187. QPainter dbPainter;
  188. dbPainter.begin(m_doubleBuffer);
  189. m_layermanager->drawImage(&dbPainter);
  190. m_layermanager->drawGeoms(&dbPainter);
  191. // draw scale
  192. if (scaleVisible)
  193. {
  194. static QList<double> distanceList;
  195. if (distanceList.isEmpty())
  196. {
  197. distanceList<<5000000<<2000000<<1000000<<1000000<<1000000<<100000<<100000<<50000<<50000<<10000<<10000<<10000<<1000<<1000<<500<<200<<100<<50<<25;
  198. }
  199. if (currentZoom() >= m_layermanager->minZoom() && distanceList.size() > currentZoom())
  200. {
  201. double line;
  202. line = distanceList.at( currentZoom() ) / pow(2.0, 18-currentZoom() ) / 0.597164;
  203. // draw the scale
  204. dbPainter.setPen(Qt::black);
  205. QPoint p1(10,size.height()-20);
  206. QPoint p2((int)line,size.height()-20);
  207. dbPainter.drawLine(p1,p2);
  208. dbPainter.drawLine(10,size.height()-15, 10,size.height()-25);
  209. dbPainter.drawLine((int)line,size.height()-15, (int)line,size.height()-25);
  210. QString distance;
  211. if (distanceList.at(currentZoom()) >= 1000)
  212. {
  213. distance = QVariant( distanceList.at(currentZoom())/1000 ) .toString()+ " km";
  214. }
  215. else
  216. {
  217. distance = QVariant( distanceList.at(currentZoom()) ).toString() + " m";
  218. }
  219. dbPainter.drawText(QPoint((int)line+10,size.height()-15), distance);
  220. }
  221. }
  222. if (crosshairsVisible)
  223. {
  224. dbPainter.drawLine(screen_middle.x(), screen_middle.y()-10,
  225. screen_middle.x(), screen_middle.y()+10); // |
  226. dbPainter.drawLine(screen_middle.x()-10, screen_middle.y(),
  227. screen_middle.x()+10, screen_middle.y()); // -
  228. }
  229. dbPainter.drawRect(0,0, size.width(), size.height());
  230. if (mousepressed && mymousemode == Dragging)
  231. {
  232. QRect rect = QRect(pre_click_px, current_mouse_pos);
  233. dbPainter.drawRect(rect);
  234. }
  235. dbPainter.end();
  236. QPainter painter;
  237. painter.begin( this );
  238. painter.drawPixmap( rect(), *m_doubleBuffer, m_doubleBuffer->rect() );
  239. painter.end();
  240. }
  241. // mouse events
  242. void MapControl::mousePressEvent(QMouseEvent* evnt)
  243. {
  244. m_layermanager->mouseEvent(evnt);
  245. if (m_layermanager->layers().size()>0)
  246. {
  247. if (evnt->button() == 1)
  248. {
  249. mousepressed = true;
  250. pre_click_px = QPoint(evnt->x(), evnt->y());
  251. }
  252. else if ( evnt->button() == 2 &&
  253. mouseWheelEventsEnabled() &&
  254. mymousemode != None) // zoom in
  255. {
  256. zoomIn();
  257. }
  258. else if ( evnt->button() == 4 &&
  259. mouseWheelEventsEnabled() &&
  260. mymousemode != None) // zoom out
  261. {
  262. zoomOut();
  263. }
  264. }
  265. // emit(mouseEvent(evnt));
  266. emit(mouseEventCoordinate(evnt, clickToWorldCoordinate(evnt->pos())));
  267. }
  268. void MapControl::mouseReleaseEvent(QMouseEvent* evnt)
  269. {
  270. mousepressed = false;
  271. if (mymousemode == Dragging)
  272. {
  273. QPointF ulCoord = clickToWorldCoordinate(pre_click_px);
  274. QPointF lrCoord = clickToWorldCoordinate(current_mouse_pos);
  275. QRectF coordinateBB = QRectF(ulCoord, QSizeF( (lrCoord-ulCoord).x(), (lrCoord-ulCoord).y()));
  276. emit(boxDragged(coordinateBB));
  277. }
  278. emit(mouseEventCoordinate(evnt, clickToWorldCoordinate(evnt->pos())));
  279. }
  280. void MapControl::mouseMoveEvent(QMouseEvent* evnt)
  281. {
  282. if (mousepressed && mymousemode == Panning)
  283. {
  284. QPoint offset = pre_click_px - QPoint(evnt->x(), evnt->y());
  285. m_layermanager->scrollView(offset);
  286. pre_click_px = QPoint(evnt->x(), evnt->y());
  287. emit viewChanged(currentCoordinate(), currentZoom());
  288. }
  289. else if (mousepressed && mymousemode == Dragging)
  290. {
  291. current_mouse_pos = QPoint(evnt->x(), evnt->y());
  292. }
  293. update();
  294. }
  295. void MapControl::wheelEvent(QWheelEvent *evnt)
  296. {
  297. if(mouse_wheel_events &&
  298. evnt->orientation() == Qt::Vertical)
  299. {
  300. if(evnt->delta() > 0)
  301. {
  302. if( currentZoom() == m_layermanager->maxZoom() )
  303. {
  304. return;
  305. }
  306. setView(clickToWorldCoordinate(evnt->pos())); //zoom in under mouse cursor
  307. zoomIn();
  308. }
  309. else
  310. {
  311. if( currentZoom() == m_layermanager->minZoom() )
  312. {
  313. return;
  314. }
  315. zoomOut();
  316. }
  317. evnt->accept();
  318. }
  319. else
  320. {
  321. evnt->ignore();
  322. }
  323. }
  324. ImageManager* MapControl::getImageManager()
  325. {
  326. return m_imagemanager;
  327. }
  328. QPointF MapControl::clickToWorldCoordinate(QPoint click)
  329. {
  330. if ( !m_layermanager->layer() || !m_layermanager->layer()->mapadapter() )
  331. {
  332. qDebug() << "MapControl::clickToWorldCoordinate() - no layers configured";
  333. return QPointF();
  334. }
  335. // click coordinate to image coordinate
  336. QPoint displayToImage= QPoint(click.x()-screen_middle.x()+m_layermanager->getMapmiddle_px().x(),
  337. click.y()-screen_middle.y()+m_layermanager->getMapmiddle_px().y());
  338. // image coordinate to world coordinate
  339. return m_layermanager->layer()->mapadapter()->displayToCoordinate(displayToImage);
  340. }
  341. void MapControl::updateRequest(QRect rect)
  342. {
  343. update(rect);
  344. }
  345. void MapControl::updateRequestNew()
  346. {
  347. m_layermanager->forceRedraw();
  348. }
  349. // slots
  350. void MapControl::zoomIn()
  351. {
  352. m_layermanager->zoomIn();
  353. updateView();
  354. // emit viewChanged(currentCoordinate(), currentZoom());
  355. }
  356. void MapControl::zoomOut()
  357. {
  358. m_layermanager->zoomOut();
  359. updateView();
  360. // emit viewChanged(currentCoordinate(), currentZoom());
  361. }
  362. void MapControl::setZoom(int zoomlevel)
  363. {
  364. m_layermanager->setZoom(zoomlevel);
  365. updateView();
  366. // emit viewChanged(currentCoordinate(), currentZoom());
  367. }
  368. int MapControl::currentZoom() const
  369. {
  370. return m_layermanager->currentZoom();
  371. }
  372. void MapControl::scrollLeft(int pixel)
  373. {
  374. m_layermanager->scrollView(QPoint(-pixel,0));
  375. updateView();
  376. }
  377. void MapControl::scrollRight(int pixel)
  378. {
  379. m_layermanager->scrollView(QPoint(pixel,0));
  380. updateView();
  381. }
  382. void MapControl::scrollUp(int pixel)
  383. {
  384. m_layermanager->scrollView(QPoint(0,-pixel));
  385. updateView();
  386. }
  387. void MapControl::scrollDown(int pixel)
  388. {
  389. m_layermanager->scrollView(QPoint(0,pixel));
  390. updateView();
  391. }
  392. void MapControl::scroll(const QPoint scroll)
  393. {
  394. m_layermanager->scrollView(scroll);
  395. updateView();
  396. }
  397. void MapControl::updateView() const
  398. {
  399. m_layermanager->setView( currentCoordinate() );
  400. emit viewChanged(currentCoordinate(), currentZoom());
  401. }
  402. void MapControl::setView(const QPointF& coordinate) const
  403. {
  404. m_layermanager->setView(coordinate);
  405. emit viewChanged(currentCoordinate(), currentZoom());
  406. }
  407. void MapControl::setView(const QList<QPointF> coordinates) const
  408. {
  409. m_layermanager->setView(coordinates);
  410. emit viewChanged(currentCoordinate(), currentZoom());
  411. }
  412. void MapControl::setViewAndZoomIn(const QList<QPointF> coordinates) const
  413. {
  414. m_layermanager->setViewAndZoomIn(coordinates);
  415. emit viewChanged(currentCoordinate(), currentZoom());
  416. }
  417. void MapControl::setView(const mapPoint* point) const
  418. {
  419. m_layermanager->setView(point->coordinate());
  420. }
  421. void MapControl::loadingFinished()
  422. {
  423. m_layermanager->removeZoomImage();
  424. }
  425. void MapControl::addLayer(Layer* layer)
  426. {
  427. layer->setImageManager(m_imagemanager);
  428. m_layermanager->addLayer(layer);
  429. update();
  430. }
  431. void MapControl::removeLayer( Layer* layer )
  432. {
  433. disconnect(layer, 0, 0, 0);
  434. m_layermanager->removeLayer( layer );
  435. update();
  436. }
  437. void MapControl::setMouseMode(MouseMode mousemode)
  438. {
  439. mymousemode = mousemode;
  440. }
  441. MapControl::MouseMode MapControl::mouseMode()
  442. {
  443. return mymousemode;
  444. }
  445. void MapControl::stopFollowing(const Geometry* geom) const
  446. {
  447. disconnect(geom,SIGNAL(positionChanged(Geometry*)), this, SLOT(positionChanged(Geometry*)));
  448. }
  449. void MapControl::enablePersistentCache( const QDir& path, const int qDiskSizeMB )
  450. {
  451. m_imagemanager->setCacheDir( path, qDiskSizeMB );
  452. }
  453. void MapControl::setProxy(QString host, int port, const QString username, const QString password)
  454. {
  455. m_imagemanager->setProxy(host, port, username, password);
  456. }
  457. void MapControl::showScale(bool visible)
  458. {
  459. scaleVisible = visible;
  460. }
  461. void MapControl::showCrosshairs(bool visible)
  462. {
  463. crosshairsVisible = visible;
  464. }
  465. void MapControl::resize(const QSize newSize)
  466. {
  467. this->size = newSize;
  468. screen_middle = QPoint(newSize.width()/2, newSize.height()/2);
  469. this->setMaximumSize(newSize.width()+1, newSize.height()+1);
  470. m_layermanager->resize(newSize);
  471. QFrame::resize(newSize);
  472. emit viewChanged(currentCoordinate(), currentZoom());
  473. }
  474. void MapControl::setUseBoundingBox( bool usebounds )
  475. {
  476. if( m_layermanager )
  477. m_layermanager->setUseBoundingBox( usebounds );
  478. }
  479. bool MapControl::isBoundingBoxEnabled()
  480. {
  481. if( m_layermanager )
  482. return m_layermanager->isBoundingBoxEnabled();
  483. return false;
  484. }
  485. void MapControl::setBoundingBox( QRectF &rect )
  486. {
  487. if( m_layermanager )
  488. m_layermanager->setBoundingBox( rect );
  489. }
  490. QRectF MapControl::getBoundingBox()
  491. {
  492. if( m_layermanager )
  493. return m_layermanager->getBoundingBox();
  494. // Return an empty QRectF if there is no m_layermanager
  495. return QRectF();
  496. }
  497. QRectF MapControl::getViewport()
  498. {
  499. if( m_layermanager )
  500. return m_layermanager->getViewport();
  501. // Return an empty QRectF if there is no m_layermanager
  502. return QRectF();
  503. }
  504. bool MapControl::isGeometryVisible( Geometry * geometry)
  505. {
  506. if ( !geometry || getViewport() == QRectF() )
  507. return false;
  508. return getViewport().contains( geometry->boundingBox() );
  509. }
  510. int MapControl::loadingQueueSize()
  511. {
  512. return m_imagemanager->loadQueueSize();
  513. }
  514. //void MapControl::mouseEventCoordinate(const QMouseEvent* evnt, const QPointF coordinate){};
  515. //! Emitted, after a Rectangular is dragged.
  516. /*!
  517. * It is possible to select a rectangular area in the map, if the MouseMode is set to Dragging.
  518. * The coordinates are in world coordinates
  519. * @param QRectF the dragged Rect
  520. */
  521. //void MapControl::boxDragged(const QRectF){};
  522. //! This signal is emitted, when a Geometry is clicked
  523. /*!
  524. * @param geometry The clicked Geometry object
  525. * @param coord_px The coordinate in pixel coordinates
  526. */
  527. //void MapControl::geometryClicked(Geometry* geometry, QPoint coord_px){};
  528. //! This signal is emitted, after the view have changed
  529. /*!
  530. * @param coordinate The current coordinate
  531. * @param zoom The current zoom
  532. */
  533. //void MapControl::viewChanged(const QPointF &coordinate, int zoom) const {};
  534. // SIGNAL 0
  535. void MapControl::mouseEventCoordinate(const QMouseEvent * _t1, const QPointF _t2)
  536. {
  537. void *_a[] = { Q_NULLPTR, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
  538. QMetaObject::activate(this, &staticMetaObject, 0, _a);
  539. }
  540. // SIGNAL 1
  541. void MapControl::boxDragged(const QRectF _t1)
  542. {
  543. void *_a[] = { Q_NULLPTR, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
  544. QMetaObject::activate(this, &staticMetaObject, 1, _a);
  545. }
  546. // SIGNAL 2
  547. void MapControl::geometryClicked(Geometry * _t1, QPoint _t2)
  548. {
  549. void *_a[] = { Q_NULLPTR, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
  550. QMetaObject::activate(this, &staticMetaObject, 2, _a);
  551. }
  552. // SIGNAL 3
  553. void MapControl::viewChanged(const QPointF & _t1, int _t2)const
  554. {
  555. void *_a[] = { Q_NULLPTR, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
  556. QMetaObject::activate(const_cast< MapControl *>(this), &staticMetaObject, 3, _a);
  557. }