可以显示高程信息,还需优化
This commit is contained in:
@@ -76,13 +76,12 @@ OPMapWidget::OPMapWidget(QWidget *parent, Configuration *config) : QGraphicsView
|
||||
SetShowCompass(false);
|
||||
QPixmapCache::setCacheLimit(1024 * 1024);//set 1M byte
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
setOverlayOpacity(overlayOpacity);
|
||||
|
||||
altitudeitem = new AltitudeItem(map,Qt::red);
|
||||
altitudeitem->setParentItem(map);
|
||||
|
||||
altitudeitem->setPos(0,this->height() - altitudeitem->boundingRect().height());
|
||||
|
||||
|
||||
}
|
||||
@@ -407,6 +406,7 @@ void OPMapWidget::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
WPLineCreate(WPFind(Item->Number() - 1),Item,Qt::green,false,2);
|
||||
|
||||
|
||||
/*
|
||||
AltitudeItem *AltItem = new AltitudeItem(map,Qt::red);
|
||||
AltItem->setParentItem(map);
|
||||
|
||||
@@ -414,6 +414,8 @@ void OPMapWidget::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
|
||||
AltItem->setPos(Item->Number() * 20,this->height() - AltItem->boundingRect().height());
|
||||
|
||||
*/
|
||||
|
||||
qDebug() << "WPCreate Point"
|
||||
<< QThread::currentThreadId();
|
||||
}
|
||||
@@ -840,6 +842,7 @@ void OPMapWidget::ConnectWP(WayPointItem *item)
|
||||
|
||||
|
||||
|
||||
|
||||
connect(item,SIGNAL(ElevationChanged(int,double)),
|
||||
this,SLOT(ElevationChanged(int,double)), Qt::DirectConnection);
|
||||
|
||||
@@ -1382,32 +1385,34 @@ void OPMapWidget::setMapTypes(QVariant value)
|
||||
|
||||
void OPMapWidget::ElevationChanged(int seq,double value)
|
||||
{
|
||||
QMap<int,float> Info;
|
||||
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
AltitudeItem *w = qgraphicsitem_cast<AltitudeItem *>(i);
|
||||
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
|
||||
if (w)
|
||||
{
|
||||
if(w->Number() == seq)
|
||||
{
|
||||
w->setElevation(value);
|
||||
break;
|
||||
}
|
||||
if(!w->FollowPrevious())
|
||||
Info.insert(w->Number(),w->getElevation());
|
||||
}
|
||||
}
|
||||
|
||||
altitudeitem->setElevation(Info);
|
||||
}
|
||||
|
||||
void OPMapWidget::AltitudeChanged(int seq,double value)
|
||||
{
|
||||
QMap<int,float> Info;
|
||||
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
AltitudeItem *w = qgraphicsitem_cast<AltitudeItem *>(i);
|
||||
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
|
||||
if (w)
|
||||
{
|
||||
if(w->Number() == seq)
|
||||
{
|
||||
w->setAltitude(value);
|
||||
break;
|
||||
}
|
||||
if(!w->FollowPrevious())
|
||||
Info.insert(w->Number(),w->Alt());
|
||||
}
|
||||
}
|
||||
|
||||
altitudeitem->setAltitude(Info);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user