b
This commit is contained in:
@@ -113,8 +113,6 @@ void MavLinkNode::stop()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//这里一直在解码,一直检查双缓冲里面是否有数据,有就解码,没有就休息
|
||||
void MavLinkNode::process()//线程函数
|
||||
{
|
||||
|
||||
@@ -42,7 +42,6 @@ OPMapWidget::OPMapWidget(QWidget *parent, Configuration *config) : QGraphicsView
|
||||
QDir *MapDir = new QDir;
|
||||
if(!MapDir->exists("./maps"))
|
||||
MapDir->mkdir("./maps");//如果文件夹不存在就新建
|
||||
|
||||
config->SetCacheLocation("./maps/");
|
||||
|
||||
map = new MapGraphicItem(core, config);
|
||||
@@ -242,9 +241,6 @@ void OPMapWidget::mouseMoveEvent(QMouseEvent *event)
|
||||
p = map->mapFromParent(p);
|
||||
currentmouseposition = map->FromLocalToLatLng(p.x(), p.y());
|
||||
|
||||
|
||||
|
||||
|
||||
emit EmitCurrentMousePosition(currentmouseposition);
|
||||
}
|
||||
|
||||
@@ -276,6 +272,8 @@ void OPMapWidget::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
|
||||
LatLng = map->FromLocalToLatLng(p.x(), p.y());
|
||||
|
||||
|
||||
//生成一个列表
|
||||
WPCreate(LatLng,0);
|
||||
|
||||
|
||||
@@ -602,8 +600,13 @@ void OPMapWidget::OnSelectionChanged()
|
||||
foreach(QGraphicsItem * item, list) {
|
||||
WayPointItem *wp = qgraphicsitem_cast<WayPointItem *>(item);
|
||||
|
||||
qDebug() << wp->Number();
|
||||
|
||||
if (wp) {
|
||||
wplist.append(wp);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if (wplist.length() > 0) {
|
||||
|
||||
@@ -201,17 +201,15 @@ void WayPointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
|
||||
painter->drawLine(-6,-6,6,6);
|
||||
painter->drawLine(-6,6,6,-6);
|
||||
|
||||
|
||||
|
||||
if (this->isSelected()) {
|
||||
painter->setPen(Qt::red);
|
||||
painter->drawRect(QRectF(-10,-10,20,20));
|
||||
painter->drawRect(QRectF(boundingRect()));
|
||||
}
|
||||
}
|
||||
void WayPointItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
qInfo() << "DoubleClickEvent";
|
||||
//qInfo() << "DoubleClickEvent";
|
||||
emit waypointdoubleclick(this);
|
||||
}
|
||||
}
|
||||
@@ -219,7 +217,7 @@ void WayPointItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
||||
void WayPointItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
qInfo() << "PressEvent";
|
||||
//qInfo() << "PressEvent";
|
||||
isDragging = true;
|
||||
}
|
||||
QGraphicsItem::mousePressEvent(event);
|
||||
@@ -227,7 +225,7 @@ void WayPointItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
void WayPointItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
qInfo() << "ReleaseEvent";
|
||||
//qInfo() << "ReleaseEvent";
|
||||
isDragging = false;
|
||||
emit manualCoordChange(this);
|
||||
emit localPositionChanged(this->pos(), this);
|
||||
|
||||
Reference in New Issue
Block a user