在line里面添加变量就死机,搞不懂
This commit is contained in:
@@ -789,7 +789,7 @@ void OPMapWidget::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
////////////////WAYPOINT////////////////////////
|
||||
WayPointItem *OPMapWidget::WPCreate()
|
||||
{
|
||||
WayPointItem *item = new WayPointItem(this->CurrentPosition(), 0, map);
|
||||
WayPointItem *item = new WayPointItem(this->CurrentPosition(), 0,1, map);
|
||||
|
||||
ConnectWP(item);
|
||||
item->setParentItem(map);
|
||||
@@ -800,7 +800,7 @@ WayPointItem *OPMapWidget::WPCreate()
|
||||
}
|
||||
WayPointItem *OPMapWidget::magicWPCreate()
|
||||
{
|
||||
WayPointItem *item = new WayPointItem(map, true);
|
||||
WayPointItem *item = new WayPointItem(1,map, true);
|
||||
|
||||
item->SetShowNumber(false);
|
||||
item->setParentItem(map);
|
||||
@@ -818,7 +818,7 @@ void OPMapWidget::WPCreate(WayPointItem *item)
|
||||
}
|
||||
WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int const & altitude)
|
||||
{
|
||||
WayPointItem *item = new WayPointItem(coord, altitude, map);
|
||||
WayPointItem *item = new WayPointItem(coord, altitude,1, map);
|
||||
|
||||
ConnectWP(item);
|
||||
item->setParentItem(map);
|
||||
@@ -830,7 +830,7 @@ WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int co
|
||||
}
|
||||
WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int const & altitude, QString const & description)
|
||||
{
|
||||
WayPointItem *item = new WayPointItem(coord, altitude, description, map);
|
||||
WayPointItem *item = new WayPointItem(coord, altitude,1, description, map);
|
||||
|
||||
ConnectWP(item);
|
||||
item->setParentItem(map);
|
||||
@@ -842,7 +842,7 @@ WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int co
|
||||
}
|
||||
WayPointItem *OPMapWidget::WPCreate(const distBearingAltitude &relativeCoord, const QString &description)
|
||||
{
|
||||
WayPointItem *item = new WayPointItem(relativeCoord, description, map);
|
||||
WayPointItem *item = new WayPointItem(relativeCoord,1, description, map);
|
||||
|
||||
ConnectWP(item);
|
||||
item->setParentItem(map);
|
||||
@@ -907,7 +907,7 @@ void OPMapWidget::WPInsert()
|
||||
|
||||
if(item_old1)//如果指定的点存在,那么就可以在这之前插入一个点
|
||||
{
|
||||
WayPointItem *item = new WayPointItem(latlng, item_old1->Altitude(), map);
|
||||
WayPointItem *item = new WayPointItem(latlng, item_old1->Altitude(), 1,map);
|
||||
|
||||
ConnectWP(item);
|
||||
item->SetNumber(position);
|
||||
@@ -990,7 +990,7 @@ void OPMapWidget::WPInsert(WayPointItem *item, const int &position)
|
||||
}
|
||||
WayPointItem *OPMapWidget::WPInsert(internals::PointLatLng const & coord, int const & altitude, const int &position)
|
||||
{
|
||||
WayPointItem *item = new WayPointItem(coord, altitude, map);
|
||||
WayPointItem *item = new WayPointItem(coord, altitude,1, map);
|
||||
|
||||
item->SetNumber(position);
|
||||
ConnectWP(item);
|
||||
@@ -1011,7 +1011,7 @@ WayPointItem *OPMapWidget::WPInsert(internals::PointLatLng const & coord, int co
|
||||
} else {
|
||||
mcoord = coord;
|
||||
}
|
||||
WayPointItem *item = new WayPointItem(mcoord, altitude, description, map);
|
||||
WayPointItem *item = new WayPointItem(mcoord, altitude,1, description, map);
|
||||
item->SetNumber(position);
|
||||
ConnectWP(item);
|
||||
item->setParentItem(map);
|
||||
@@ -1025,7 +1025,7 @@ WayPointItem *OPMapWidget::WPInsert(internals::PointLatLng const & coord, int co
|
||||
}
|
||||
WayPointItem *OPMapWidget::WPInsert(distBearingAltitude const & relative, QString const & description, const int &position)
|
||||
{
|
||||
WayPointItem *item = new WayPointItem(relative, description, map);
|
||||
WayPointItem *item = new WayPointItem(relative,1, description, map);
|
||||
|
||||
item->SetNumber(position);
|
||||
ConnectWP(item);
|
||||
|
||||
@@ -35,13 +35,13 @@
|
||||
|
||||
|
||||
namespace mapcontrol {
|
||||
WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & altitude, MapGraphicItem *map, wptype type) : coord(coord), reached(false), description(""), shownumber(true), isDragging(false), altitude(altitude), map(map), myType(type)
|
||||
WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & altitude,int seq, MapGraphicItem *map, wptype type) : coord(coord), reached(false), description(""), shownumber(true), isDragging(false), altitude(altitude), map(map), myType(type)
|
||||
{
|
||||
numberI = 0;
|
||||
isEdit = true;
|
||||
isMagic = false;
|
||||
property.seq = WayPointItem::snumber;
|
||||
++WayPointItem::snumber;
|
||||
property.seq = seq;
|
||||
//++WayPointItem::snumber;
|
||||
this->setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||
this->setFlag(QGraphicsItem::ItemIgnoresTransformations, true);
|
||||
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||
@@ -74,7 +74,7 @@ WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & alti
|
||||
|
||||
}
|
||||
|
||||
WayPointItem::WayPointItem(MapGraphicItem *map, bool magicwaypoint) : reached(false), description(""), shownumber(true), isDragging(false), altitude(0), map(map)
|
||||
WayPointItem::WayPointItem(int seq, MapGraphicItem *map, bool magicwaypoint) : reached(false), description(""), shownumber(true), isDragging(false), altitude(0), map(map)
|
||||
{
|
||||
isEdit = true;
|
||||
relativeCoord.bearing = 0;
|
||||
@@ -86,8 +86,8 @@ WayPointItem::WayPointItem(MapGraphicItem *map, bool magicwaypoint) : reached(fa
|
||||
property.seq = -1;
|
||||
} else {
|
||||
isMagic = false;
|
||||
property.seq = WayPointItem::snumber;
|
||||
++WayPointItem::snumber;
|
||||
property.seq = seq;
|
||||
//++WayPointItem::snumber;
|
||||
}
|
||||
numberI = 0;
|
||||
this->setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||
@@ -120,14 +120,14 @@ WayPointItem::WayPointItem(MapGraphicItem *map, bool magicwaypoint) : reached(fa
|
||||
|
||||
this->setZValue(3);
|
||||
}
|
||||
WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & altitude, const QString &description, MapGraphicItem *map, wptype type) : coord(coord), reached(false), description(description), shownumber(true), isDragging(false), altitude(altitude), map(map), myType(type)
|
||||
WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & altitude,int seq, const QString &description, MapGraphicItem *map, wptype type) : coord(coord), reached(false), description(description), shownumber(true), isDragging(false), altitude(altitude), map(map), myType(type)
|
||||
{
|
||||
isEdit = true;
|
||||
numberI = 0;
|
||||
isMagic = false;
|
||||
//picture.load(QString::fromUtf8(":/markers/images/marker.png"));
|
||||
property.seq = WayPointItem::snumber;
|
||||
++WayPointItem::snumber;
|
||||
property.seq = seq;
|
||||
//++WayPointItem::snumber;
|
||||
this->setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||
this->setFlag(QGraphicsItem::ItemIgnoresTransformations, true);
|
||||
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||
@@ -158,7 +158,7 @@ WayPointItem::WayPointItem(const internals::PointLatLng &coord, int const & alti
|
||||
this->setZValue(3);
|
||||
}
|
||||
|
||||
WayPointItem::WayPointItem(const distBearingAltitude &relativeCoordenate, const QString &description, MapGraphicItem *map) : relativeCoord(relativeCoordenate), reached(false), description(description), shownumber(true), isDragging(false), map(map)
|
||||
WayPointItem::WayPointItem(const distBearingAltitude &relativeCoordenate,int seq, const QString &description, MapGraphicItem *map) : relativeCoord(relativeCoordenate), reached(false), description(description), shownumber(true), isDragging(false), map(map)
|
||||
{
|
||||
isEdit = true;
|
||||
myHome = NULL;
|
||||
@@ -178,8 +178,8 @@ WayPointItem::WayPointItem(const distBearingAltitude &relativeCoordenate, const
|
||||
myType = relative;
|
||||
numberI = 0;
|
||||
isMagic = false;
|
||||
property.seq = WayPointItem::snumber;
|
||||
++WayPointItem::snumber;
|
||||
property.seq = seq;
|
||||
//++WayPointItem::snumber;
|
||||
this->setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||
this->setFlag(QGraphicsItem::ItemIgnoresTransformations, true);
|
||||
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||
@@ -630,7 +630,7 @@ WayPointItem::~WayPointItem()
|
||||
{
|
||||
emit aboutToBeDeleted(this);
|
||||
|
||||
--WayPointItem::snumber;
|
||||
//--WayPointItem::snumber;
|
||||
}
|
||||
void WayPointItem::RefreshPos()
|
||||
{
|
||||
@@ -951,7 +951,7 @@ void WayPointItem::ElevationUpdate(QNetworkReply *reply)
|
||||
|
||||
|
||||
//==============全局计数===================
|
||||
int WayPointItem::snumber = 1;//从1开始
|
||||
//int WayPointItem::snumber = 1;//从1开始
|
||||
int WayPointItem::gnumber = 0;//组计数从1开始
|
||||
}
|
||||
|
||||
|
||||
@@ -106,10 +106,10 @@ public:
|
||||
|
||||
|
||||
|
||||
WayPointItem(internals::PointLatLng const & coord, int const & altitude, MapGraphicItem *map, wptype type = absolute);
|
||||
WayPointItem(MapGraphicItem *map, bool magicwaypoint);
|
||||
WayPointItem(internals::PointLatLng const & coord, int const & altitude, QString const & description, MapGraphicItem *map, wptype type = absolute);
|
||||
WayPointItem(distBearingAltitude const & relativeCoord, QString const & description, MapGraphicItem *map);
|
||||
WayPointItem(internals::PointLatLng const & coord, int const & altitude,int seq, MapGraphicItem *map, wptype type = absolute);
|
||||
WayPointItem(int seq, MapGraphicItem *map, bool magicwaypoint);
|
||||
WayPointItem(internals::PointLatLng const & coord, int const & altitude, int seq, QString const & description, MapGraphicItem *map, wptype type = absolute);
|
||||
WayPointItem(distBearingAltitude const & relativeCoord,int seq, QString const & description, MapGraphicItem *map);
|
||||
|
||||
QString Description()
|
||||
{
|
||||
@@ -174,7 +174,7 @@ public:
|
||||
void setFlag(GraphicsItemFlag flag, bool enabled);
|
||||
~WayPointItem();
|
||||
|
||||
static int snumber;
|
||||
//static int snumber;
|
||||
static int gnumber;
|
||||
|
||||
|
||||
|
||||
@@ -174,8 +174,6 @@ void WayPointLine::WPLinedelete(WayPointItem *from, WayPointItem *to)
|
||||
{
|
||||
Q_UNUSED(from)
|
||||
Q_UNUSED(to)
|
||||
|
||||
|
||||
this->deleteLater();
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,18 @@ public:
|
||||
{
|
||||
return isactive;
|
||||
}
|
||||
/*
|
||||
void setGroups(int value)
|
||||
{
|
||||
groups = value;
|
||||
update();
|
||||
}
|
||||
|
||||
int Groups(void)
|
||||
{
|
||||
return groups;
|
||||
}
|
||||
*/
|
||||
|
||||
private:
|
||||
QGraphicsItem *source;
|
||||
@@ -88,6 +100,10 @@ private:
|
||||
int lineWidth;
|
||||
|
||||
bool isactive = true;
|
||||
//int my_group;
|
||||
|
||||
|
||||
bool isEdit = false;
|
||||
|
||||
protected:
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
@@ -110,18 +126,6 @@ public slots:
|
||||
void setOpacitySlot(qreal opacity);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
bool isEdit = false;
|
||||
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
#endif // WAYPOINTLINE_H
|
||||
|
||||
Reference in New Issue
Block a user