source: subversion/applications/editors/merkaartor/Main.cpp @ 7774

Last change on this file since 7774 was 7774, checked in by bvh, 12 years ago

ADD : load Qt plugins for application bundle with Mac

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1#include <QtGui/QApplication>
2#include <QtGui/QMessageBox> 
3
4#include <QTranslator>
5#include <QLocale>
6
7#include "MainWindow.h"
8
9int main(int argc, char** argv)
10{
11        QApplication app(argc,argv);
12
13        QCoreApplication::setOrganizationName("BartVanhauwaert");
14        QCoreApplication::setOrganizationDomain("www.irule.be");
15        QCoreApplication::setApplicationName("Merkaartor");
16
17#if defined(Q_OS_MAC)
18        QDir dir(QApplication::applicationDirPath());
19        dir.cdUp();
20        dir.cd("plugins");
21        QApplication::setLibraryPaths(QStringList(dir.absolutePath()));
22#endif
23        QTranslator qtTranslator;
24        qtTranslator.load("qt_" + QLocale::system().name()
25#ifdef TRANSDIR_SYSTEM
26        , TRANSDIR_SYSTEM
27#endif
28        );
29        app.installTranslator(&qtTranslator);
30
31        QTranslator merkaartorTranslator;
32        merkaartorTranslator.load("merkaartor_" + QLocale::system().name()
33#ifdef TRANSDIR_MERKAARTOR
34        , TRANSDIR_MERKAARTOR
35#endif
36        );
37        app.installTranslator(&merkaartorTranslator);
38
39        MainWindow Main;
40
41        const QStringList & params = QCoreApplication::arguments();
42        if (params.size() == 2)
43                Main.loadFile(params.at(1));
44       
45        Main.show();
46
47        return app.exec();
48}
49
50
Note: See TracBrowser for help on using the repository browser.