1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

Minor cleaning

This commit is contained in:
PT_Dreamer 2012-05-08 16:22:06 +01:00 committed by James Cotton
parent c95eeb92bb
commit 74d96d0073
2 changed files with 13 additions and 1 deletions

View File

@ -40,6 +40,7 @@ namespace mapcontrol
core->SetCurrentRegion(internals::Rectangle(0, 0, maprect.width(), maprect.height()));
core->SetMapType(MapType::GoogleHybrid);
this->SetZoom(2);
this->setFlag(ItemIsFocusable);
connect(core,SIGNAL(OnNeedInvalidation()),this,SLOT(Core_OnNeedInvalidation()));
connect(core,SIGNAL(OnMapDrag()),this,SLOT(ChildPosRefresh()));
connect(core,SIGNAL(OnMapZoomChanged()),this,SLOT(ChildPosRefresh()));
@ -238,7 +239,6 @@ namespace mapcontrol
selectionStart = FromLocalToLatLng(event->pos().x(), event->pos().y());
}
}
}
void MapGraphicItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
@ -272,6 +272,16 @@ namespace mapcontrol
}
}
void MapGraphicItem::keyPressEvent(QKeyEvent *event)
{
if(event->modifiers()&(Qt::ShiftModifier|Qt::ControlModifier))
this->setCursor(Qt::CrossCursor);
}
void MapGraphicItem::keyReleaseEvent(QKeyEvent *event)
{
if((event->modifiers()&(Qt::ShiftModifier|Qt::ControlModifier))==0)
this->setCursor(Qt::ArrowCursor);
}
bool MapGraphicItem::SetZoomToFitRect(internals::RectLatLng const& rect)
{
int maxZoom = core->GetMaxZoomToFitRect(rect);

View File

@ -107,6 +107,8 @@ namespace mapcontrol
void wheelEvent ( QGraphicsSceneWheelEvent * event );
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
bool IsMouseOverMarker()const{return isMouseOverMarker;}
void keyPressEvent ( QKeyEvent * event );
void keyReleaseEvent ( QKeyEvent * event );
/**
* @brief Returns current map zoom