nesca/main.cpp

33 lines
764 B
C++
Raw Normal View History

2015-02-24 14:00:19 +00:00
#include "nesca_3.h"
#include <QApplication>
2015-02-24 14:14:32 +00:00
#include <qfontdatabase.h>
2015-02-24 14:00:19 +00:00
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
2015-03-23 12:52:07 +00:00
2015-02-24 14:00:19 +00:00
QStringList list;
list << "Eurostile.ttf";
int fontID(-1);
bool fontWarningShown(false);
for (QStringList::const_iterator constIterator = list.constBegin(); constIterator != list.constEnd(); ++constIterator) {
QFile res(":/nesca_3/" + *constIterator);
if (res.open(QIODevice::ReadOnly) == false) {
if (fontWarningShown == false) {
fontWarningShown = true;
}
} else {
fontID = QFontDatabase::addApplicationFontFromData(res.readAll());
if (fontID == -1 && fontWarningShown == false) {
fontWarningShown = true;
}
}
}
2015-03-07 17:31:48 +00:00
2015-02-24 14:00:19 +00:00
nesca_3 *gui = new nesca_3();
gui->showNormal();
return a.exec();
}
2015-02-24 14:14:32 +00:00