ModelRailroadTimetablePlanner/src/graph/linegraphtypes.cpp
2021-10-22 01:16:34 +02:00

24 lines
642 B
C++

#include "linegraphtypes.h"
#include <QCoreApplication>
class LineGraphTypeNames
{
Q_DECLARE_TR_FUNCTIONS(LineGraphTypeNames)
public:
static const char *texts[];
};
const char *LineGraphTypeNames::texts[] = {
QT_TRANSLATE_NOOP("LineGraphTypeNames", "No Graph"),
QT_TRANSLATE_NOOP("LineGraphTypeNames", "Station"),
QT_TRANSLATE_NOOP("LineGraphTypeNames", "Segment"),
QT_TRANSLATE_NOOP("LineGraphTypeNames", "Line")
};
QString utils::getLineGraphTypeName(LineGraphType type)
{
if(type >= LineGraphType::NTypes)
return QString();
return LineGraphTypeNames::tr(LineGraphTypeNames::texts[int(type)]);
}