mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
Reenabled double-clicking on Home to set lat/lon/altitude.
Also reduced the size of the double-click sensitive area.
This commit is contained in:
parent
98176d9829
commit
db15b01e35
@ -34,7 +34,7 @@ namespace mapcontrol
|
||||
pic=pic.scaled(30,30,Qt::IgnoreAspectRatio);
|
||||
this->setFlag(QGraphicsItem::ItemIgnoresTransformations,true);
|
||||
this->setFlag(QGraphicsItem::ItemIsMovable,false);
|
||||
this->setFlag(QGraphicsItem::ItemIsSelectable,false);
|
||||
this->setFlag(QGraphicsItem::ItemIsSelectable,true);
|
||||
localposition=map->FromLatLngToLocal(mapwidget->CurrentPosition());
|
||||
this->setPos(localposition.X(),localposition.Y());
|
||||
this->setZValue(4);
|
||||
@ -142,5 +142,14 @@ namespace mapcontrol
|
||||
}
|
||||
QGraphicsItem::mouseMoveEvent(event);
|
||||
}
|
||||
|
||||
//Set clickable area as smaller than the bounding rect.
|
||||
QPainterPath HomeItem::shape() const
|
||||
{
|
||||
QPainterPath path;
|
||||
path.addEllipse(QRectF(-12, -25, 24, 50));
|
||||
return path;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -76,6 +76,7 @@ namespace mapcontrol
|
||||
void mousePressEvent ( QGraphicsSceneMouseEvent * event );
|
||||
void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
|
||||
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
|
||||
QPainterPath shape() const;
|
||||
public slots:
|
||||
void RefreshPos();
|
||||
void setOpacitySlot(qreal opacity);
|
||||
|
Loading…
Reference in New Issue
Block a user