Commit 864a3c9d authored by LM's avatar LM

Working on home location improvements

parent ea251119
...@@ -36,6 +36,10 @@ namespace mapcontrol ...@@ -36,6 +36,10 @@ namespace mapcontrol
this->setPos(localposition.X(),localposition.Y()); this->setPos(localposition.X(),localposition.Y());
this->setZValue(4); this->setZValue(4);
coord=internals::PointLatLng(50,50); coord=internals::PointLatLng(50,50);
// this->setFlag(QGraphicsItem::ItemIsMovable,true);
// this->setFlag(QGraphicsItem::ItemIgnoresTransformations,true);
// this->setFlag(QGraphicsItem::ItemIsSelectable,true);
} }
void HomeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) void HomeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
...@@ -77,4 +81,19 @@ namespace mapcontrol ...@@ -77,4 +81,19 @@ namespace mapcontrol
} }
// void HomeItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
// {
// if(event->button()==Qt::LeftButton)
// {
// coord=map->FromLocalToLatLng(this->pos().x(),this->pos().y());
// QString coord_str = " " + QString::number(coord.Lat(), 'f', 6) + " " + QString::number(coord.Lng(), 'f', 6);
// qDebug() << "WP MOVE:" << coord_str << __FILE__ << __LINE__;
// isDragging=false;
// RefreshToolTip();
// emit WPValuesChanged(this);
// }
// QGraphicsItem::mouseReleaseEvent(event);
// }
} }
...@@ -14,7 +14,15 @@ QGCMapTool::QGCMapTool(QWidget *parent) : ...@@ -14,7 +14,15 @@ QGCMapTool::QGCMapTool(QWidget *parent) :
ui->zoomSlider->setMaximum(ui->map->MaxZoom()); ui->zoomSlider->setMaximum(ui->map->MaxZoom());
ui->zoomSlider->setValue(ui->map->ZoomReal()); ui->zoomSlider->setValue(ui->map->ZoomReal());
connect(ui->zoomSlider, SIGNAL(valueChanged(int)), ui->map, SLOT(SetZoom(int))); connect(ui->zoomSlider, SIGNAL(valueChanged(int)), ui->map, SLOT(SetZoom(int)));
connect(ui->map, SIGNAL(zoomChanged(int)), ui->zoomSlider, SLOT(setValue(int))); connect(ui->map, SIGNAL(zoomChanged(int)), this, SLOT(setZoom(int)));
}
void QGCMapTool::setZoom(int zoom)
{
if (ui->zoomSlider->value() != zoom)
{
ui->zoomSlider->setValue(zoom);
}
} }
QGCMapTool::~QGCMapTool() QGCMapTool::~QGCMapTool()
......
...@@ -15,6 +15,10 @@ public: ...@@ -15,6 +15,10 @@ public:
explicit QGCMapTool(QWidget *parent = 0); explicit QGCMapTool(QWidget *parent = 0);
~QGCMapTool(); ~QGCMapTool();
public slots:
/** @brief Update slider zoom from map change */
void setZoom(int zoom);
private: private:
Ui::QGCMapTool *ui; Ui::QGCMapTool *ui;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment