7 class MapAction
: public QAction
12 MapAction(Map
*map
, QObject
*parent
= 0) : QAction(map
->name(), parent
)
16 setData(QVariant::fromValue(map
));
17 setEnabled(map
->isReady());
18 setMenuRole(QAction::NoRole
);
21 connect(map
, &Map::mapLoaded
, this, &MapAction::mapLoaded
);
30 Map
*map
= data().value
<Map
*>();
31 setEnabled(map
->isValid());