Commit 35197f10 authored by Torsten Rahn's avatar Torsten Rahn
Browse files

Adding moveLeft, Right, Up, Down and minimum/maximumZoom to MarbleQuickItem.

parent 3cc2b95c
......@@ -526,6 +526,26 @@ namespace Marble
return d->m_hoverEnabled;
}
void MarbleQuickItem::moveUp()
{
d->m_presenter.moveByStep( 0, -1, Marble::Automatic );
}
void MarbleQuickItem::moveDown()
{
d->m_presenter.moveByStep( 0, 1, Marble::Automatic );
}
void MarbleQuickItem::moveLeft()
{
d->m_presenter.moveByStep( -1, 0, Marble::Automatic );
}
void MarbleQuickItem::moveRight()
{
d->m_presenter.moveByStep( 1, 0, Marble::Automatic );
}
qreal MarbleQuickItem::speed() const
{
return d->m_model.positionTracking()->speed();
......@@ -1193,6 +1213,16 @@ namespace Marble
return d->m_presenter.logzoom();
}
int MarbleQuickItem::minimumZoom() const
{
return d->m_presenter.minimumZoom();
}
int MarbleQuickItem::maximumZoom() const
{
return d->m_presenter.maximumZoom();
}
bool MarbleQuickItem::layersEventFilter(QObject *, QEvent *)
{ //Does nothing, but can be reimplemented in a subclass
return false;
......
......@@ -40,6 +40,8 @@ namespace Marble
Q_PROPERTY(int mapWidth READ mapWidth WRITE setMapWidth NOTIFY mapWidthChanged)
Q_PROPERTY(int mapHeight READ mapHeight WRITE setMapHeight NOTIFY mapHeightChanged)
Q_PROPERTY(int zoom READ zoom WRITE setZoom NOTIFY zoomChanged)
Q_PROPERTY(int minimumZoom READ minimumZoom NOTIFY minimumZoomChanged)
Q_PROPERTY(int maximumZoom READ maximumZoom NOTIFY maximumZoomChanged)
Q_PROPERTY(int radius READ radius WRITE setRadius NOTIFY radiusChanged)
Q_PROPERTY(qreal heading READ heading WRITE setHeading NOTIFY headingChanged)
......@@ -153,7 +155,6 @@ namespace Marble
Q_INVOKABLE void setRelationTypeVisible(const QString &relationType, bool visible);
Q_INVOKABLE bool isRelationTypeVisible(const QString &relationType) const;
void setHeading(qreal heading);
void setHoverEnabled(bool hoverEnabled);
......@@ -219,6 +220,16 @@ namespace Marble
bool hoverEnabled() const;
Q_INVOKABLE void moveUp();
Q_INVOKABLE void moveDown();
Q_INVOKABLE void moveLeft();
Q_INVOKABLE void moveRight();
int minimumZoom() const;
int maximumZoom() const;
Q_SIGNALS:
void mapWidthChanged(int mapWidth);
void mapHeightChanged(int mapHeight);
......@@ -260,6 +271,9 @@ namespace Marble
void rmbMenuRequested(const QPoint& point);
void hoverPositionChanged(const QPoint& point);
void minimumZoomChanged(int minimumZoom);
void maximumZoomChanged(int maximumZoom);
protected:
QObject *getEventFilter() const;
void pinch(const QPointF& center, qreal scale, Qt::GestureState state);
......
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