mirror of
git://projects.qi-hardware.com/nanomap.git
synced 2024-11-23 17:14:58 +02:00
remove unused funktion triggerAction() from layers
This commit is contained in:
parent
88bbfbef29
commit
8d77601115
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010 Niels Kummerfeldt <niels.kummerfeldt@tu-harburg.de>
|
* Copyright 2010-2011 Niels Kummerfeldt <niels.kummerfeldt@tu-harburg.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -43,10 +43,6 @@ void AbstractLayer::pan(const QPoint &move)
|
|||||||
Q_UNUSED(move)
|
Q_UNUSED(move)
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractLayer::triggerAction()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void AbstractLayer::keyPressed(QKeyEvent *event)
|
void AbstractLayer::keyPressed(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
Q_UNUSED(event)
|
Q_UNUSED(event)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010 Niels Kummerfeldt <niels.kummerfeldt@tu-harburg.de>
|
* Copyright 2010-2011 Niels Kummerfeldt <niels.kummerfeldt@tu-harburg.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -35,7 +35,6 @@ public:
|
|||||||
virtual void load(const QString &filename);
|
virtual void load(const QString &filename);
|
||||||
virtual void zoom(int level);
|
virtual void zoom(int level);
|
||||||
virtual void pan(const QPoint &move);
|
virtual void pan(const QPoint &move);
|
||||||
virtual void triggerAction();
|
|
||||||
virtual void keyPressed(QKeyEvent *event);
|
virtual void keyPressed(QKeyEvent *event);
|
||||||
|
|
||||||
void paintLayer(QPainter *painter);
|
void paintLayer(QPainter *painter);
|
||||||
|
13
gpslayer.cpp
13
gpslayer.cpp
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010 Niels Kummerfeldt <niels.kummerfeldt@tu-harburg.de>
|
* Copyright 2010-2011 Niels Kummerfeldt <niels.kummerfeldt@tu-harburg.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -44,18 +44,13 @@ GpsLayer::GpsLayer(MapWidget *map) :
|
|||||||
m_gps->connectGps();
|
m_gps->connectGps();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GpsLayer::triggerAction()
|
|
||||||
{
|
|
||||||
if (isVisible()) {
|
|
||||||
map()->centerOnGeoPos(m_pos.x(), m_pos.y());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GpsLayer::keyPressed(QKeyEvent *event)
|
void GpsLayer::keyPressed(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
if (event->modifiers() == Qt::NoModifier &&
|
if (event->modifiers() == Qt::NoModifier &&
|
||||||
event->key() == Qt::Key_G) {
|
event->key() == Qt::Key_G) {
|
||||||
triggerAction();
|
if (isVisible()) {
|
||||||
|
map()->centerOnGeoPos(m_pos.x(), m_pos.y());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010 Niels Kummerfeldt <niels.kummerfeldt@tu-harburg.de>
|
* Copyright 2010-2011 Niels Kummerfeldt <niels.kummerfeldt@tu-harburg.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -32,7 +32,6 @@ class GpsLayer : public AbstractLayer
|
|||||||
public:
|
public:
|
||||||
GpsLayer(MapWidget *map);
|
GpsLayer(MapWidget *map);
|
||||||
|
|
||||||
virtual void triggerAction();
|
|
||||||
virtual void keyPressed(QKeyEvent *event);
|
virtual void keyPressed(QKeyEvent *event);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010 Niels Kummerfeldt <niels.kummerfeldt@tu-harburg.de>
|
* Copyright 2010-2011 Niels Kummerfeldt <niels.kummerfeldt@tu-harburg.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -60,24 +60,19 @@ void MarkerLayer::load(const QString &filename)
|
|||||||
set.endGroup();
|
set.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MarkerLayer::triggerAction()
|
|
||||||
{
|
|
||||||
int n = 0;
|
|
||||||
if (!m_markerName.isEmpty()) {
|
|
||||||
n = m_markerName.last().toInt();
|
|
||||||
}
|
|
||||||
QString newName = QString::number(n+1);
|
|
||||||
|
|
||||||
m_markerPos << map()->geoPos();
|
|
||||||
m_markerName << newName;
|
|
||||||
emit markerAdded(newName);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MarkerLayer::keyPressed(QKeyEvent *event)
|
void MarkerLayer::keyPressed(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
if (event->key() == Qt::Key_M) {
|
if (event->key() == Qt::Key_M) {
|
||||||
if (event->modifiers() == Qt::NoModifier) {
|
if (event->modifiers() == Qt::NoModifier) {
|
||||||
triggerAction();
|
int n = 0;
|
||||||
|
if (!m_markerName.isEmpty()) {
|
||||||
|
n = m_markerName.last().toInt();
|
||||||
|
}
|
||||||
|
QString newName = QString::number(n+1);
|
||||||
|
|
||||||
|
m_markerPos << map()->geoPos();
|
||||||
|
m_markerName << newName;
|
||||||
|
emit markerAdded(newName);
|
||||||
} else if (event->modifiers() == Qt::AltModifier) {
|
} else if (event->modifiers() == Qt::AltModifier) {
|
||||||
toggleVisibility();
|
toggleVisibility();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010 Niels Kummerfeldt <niels.kummerfeldt@tu-harburg.de>
|
* Copyright 2010-2011 Niels Kummerfeldt <niels.kummerfeldt@tu-harburg.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -32,7 +32,6 @@ public:
|
|||||||
~MarkerLayer();
|
~MarkerLayer();
|
||||||
|
|
||||||
virtual void load(const QString &filename);
|
virtual void load(const QString &filename);
|
||||||
virtual void triggerAction();
|
|
||||||
virtual void keyPressed(QKeyEvent *event);
|
virtual void keyPressed(QKeyEvent *event);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
Reference in New Issue
Block a user