From adf77ef3f69e107eb36f9bb88d89bfb782ce1971 Mon Sep 17 00:00:00 2001 From: hm Date: Fri, 15 Jul 2022 11:03:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=AA=E7=BA=BF=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=EF=BC=8C=E9=80=89=E4=B8=AD=E7=9A=84=E8=A6=81=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=9C=A8=E9=A1=B6=E5=B1=82=EF=BC=8C=E6=9C=AA=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=98=BE=E7=A4=BA=E5=9C=A8=E5=BA=95=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- opmap/mapwidget/waypointitem.cpp | 50 +++++++++++++++++++++++++++----- opmap/mapwidget/waypointline.cpp | 7 +++-- 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/opmap/mapwidget/waypointitem.cpp b/opmap/mapwidget/waypointitem.cpp index 53d8ee9..b67624e 100644 --- a/opmap/mapwidget/waypointitem.cpp +++ b/opmap/mapwidget/waypointitem.cpp @@ -72,7 +72,7 @@ WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & alti connect(map, SIGNAL(childRefreshPosition()), this, SLOT(RefreshPos())); connect(map, SIGNAL(childSetOpacity(qreal)), this, SLOT(setOpacitySlot(qreal))); - this->setZValue(5); + this->setZValue(4); } @@ -122,7 +122,7 @@ WayPointItem::WayPointItem(int seq,int missiontype, MapGraphicItem *map, bool ma connect(map, SIGNAL(childRefreshPosition()), this, SLOT(RefreshPos())); connect(map, SIGNAL(childSetOpacity(qreal)), this, SLOT(setOpacitySlot(qreal))); - this->setZValue(5); + this->setZValue(4); } WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & altitude,int seq, int missiontype, const QString &description, MapGraphicItem *map, wptype type) : coord(coord), reached(false), description(description), shownumber(true), isDragging(false), altitude(altitude), map(map), myType(type) { @@ -162,7 +162,7 @@ WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & alti connect(map, SIGNAL(childRefreshPosition()), this, SLOT(RefreshPos())); connect(map, SIGNAL(childSetOpacity(qreal)), this, SLOT(setOpacitySlot(qreal))); - this->setZValue(5); + this->setZValue(4); } WayPointItem::WayPointItem(const distBearingAltitude &relativeCoordenate,int seq,int missiontype, const QString &description, MapGraphicItem *map) : relativeCoord(relativeCoordenate), reached(false), description(description), shownumber(true), isDragging(false), map(map) @@ -202,7 +202,7 @@ WayPointItem::WayPointItem(const distBearingAltitude &relativeCoordenate,int seq connect(map, SIGNAL(childRefreshPosition()), this, SLOT(RefreshPos())); connect(map, SIGNAL(childSetOpacity(qreal)), this, SLOT(setOpacitySlot(qreal))); - this->setZValue(5); + this->setZValue(4); } void WayPointItem::setWPType(wptype type) @@ -226,6 +226,36 @@ void WayPointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti Q_UNUSED(option); Q_UNUSED(widget); + /* + if(isactive == true)//激活才有颜色,否则是灰色 + { + if(isEdit == true) + { + if (this->isSelected()) { + this->setZValue(6); + } + else + { + this->setZValue(5); + } + } + else + { + this->setZValue(5); + } + } + else//没有激活是灰色 + { + if (Command() < MAV_CMD::MAV_CMD_NAV_LAST) { + this->setZValue(2); + } + else + { + this->setZValue(2); + } + } + + if(isEdit == true) { if (this->isSelected()) { @@ -239,13 +269,14 @@ void WayPointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti else { if (Command() < MAV_CMD::MAV_CMD_NAV_LAST) { - this->setZValue(6); + this->setZValue(2); } else { - this->setZValue(5); + this->setZValue(2); } } + */ @@ -273,6 +304,7 @@ void WayPointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti if (this->isSelected()) {//被选中才能是绿色 ePen.setColor(QColor("#008B00")); painter->setBrush(QColor("#008B00")); + this->setZValue(6); } else { @@ -286,6 +318,8 @@ void WayPointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti ePen.setColor(QColor("#8B4500")); painter->setBrush(QColor("#8B4500")); } + + this->setZValue(5); } } else//飞行界面 @@ -293,6 +327,7 @@ void WayPointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti if (isCurrent) {//选择作为当前才能显示绿色 ePen.setColor(QColor("#008B00")); painter->setBrush(QColor("#008B00")); + this->setZValue(6); } else { @@ -306,7 +341,7 @@ void WayPointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti ePen.setColor(QColor("#8B4500")); painter->setBrush(QColor("#8B4500")); } - + this->setZValue(5); } } } @@ -314,6 +349,7 @@ void WayPointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti { ePen.setColor(QColor("#787878")); painter->setBrush(QColor("#787878")); + this->setZValue(2); } diff --git a/opmap/mapwidget/waypointline.cpp b/opmap/mapwidget/waypointline.cpp index 08110b8..9eb1acd 100644 --- a/opmap/mapwidget/waypointline.cpp +++ b/opmap/mapwidget/waypointline.cpp @@ -90,18 +90,21 @@ void WayPointLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti if(isactive == true)//激活才有颜色,否则是灰色 { - if(isEdit == false) + + if(isEdit == true) { myPen.setColor(myColor); + setZValue(4); } else { - //myPen.setColor("#ffff00"); myPen.setColor(myColor); + setZValue(4); } } else//没有激活是灰色 { + setZValue(1); myPen.setColor(QColor("#787878")); painter->setBrush(QColor("#787878")); }