Commit 864a3c9d authored by LM's avatar LM

Working on home location improvements

parent ea251119
......@@ -36,6 +36,10 @@ namespace mapcontrol
this->setPos(localposition.X(),localposition.Y());
this->setZValue(4);
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)
......@@ -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) :
ui->zoomSlider->setMaximum(ui->map->MaxZoom());
ui->zoomSlider->setValue(ui->map->ZoomReal());
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()
......
......@@ -15,6 +15,10 @@ public:
explicit QGCMapTool(QWidget *parent = 0);
~QGCMapTool();
public slots:
/** @brief Update slider zoom from map change */
void setZoom(int zoom);
private:
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