mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
33 lines
542 B
C++
33 lines
542 B
C++
#ifndef MAPACTION_H
|
|
#define MAPACTION_H
|
|
|
|
#include <QAction>
|
|
#include "map/map.h"
|
|
|
|
class MapAction : public QAction
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
MapAction(Map *map, QObject *parent = 0) : QAction(map->name(), parent)
|
|
{
|
|
map->setParent(this);
|
|
setData(QVariant::fromValue(map));
|
|
setEnabled(map->isValid());
|
|
connect(map, SIGNAL(mapLoaded()), this, SLOT(mapLoaded()));
|
|
}
|
|
|
|
signals:
|
|
void loaded();
|
|
|
|
private slots:
|
|
void mapLoaded()
|
|
{
|
|
Map *map = data().value<Map*>();
|
|
setEnabled(map->isValid());
|
|
emit loaded();
|
|
}
|
|
};
|
|
|
|
#endif // MAPACTION_H
|