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.

656 lines
17 KiB

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