File: xyscanMain.cpp

package info (click to toggle)
xyscan 4.30-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,516 kB
  • sloc: cpp: 3,371; xml: 67; makefile: 15
file content (63 lines) | stat: -rw-r--r-- 1,577 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//-----------------------------------------------------------------------------
//  Copyright (C) 2002-2015 Thomas S. Ullrich 
//
//  This file is part of "xyscan".
//
//  This file may be used under the terms of the GNU General Public License.
//  This project is free software; you can redistribute it and/or modify it
//  under the terms of the GNU General Public License.
//  
//  Author: Thomas S. Ullrich
//  Last update: March 28, 2014
//-----------------------------------------------------------------------------
#include <QtGui>
#include <QApplication>
#include <QTranslator>
#include <iostream>
#include <QString>
#include <QFileInfo>
#include "xyscanWindow.h"
#include "xyscanVersion.h"

using namespace std;

void usage(const char* prog)
{
    cout << "Usage: " << prog << " [-v] [file]" << endl;
}

int main(int argc, char *argv[])
{
    //
    //  Init application
    //
    QApplication app(argc, argv);
    Q_INIT_RESOURCE(xyscan);
    app.setApplicationVersion(VERSION);

#ifdef Q_OS_MAC
    //
    //  Set attributes related to Retina display (Mac)
    //
    if (QGuiApplication::primaryScreen()->devicePixelRatio() > 1)
        app.setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
     

    // translation stuff
    QTranslator translator;
    translator.load("xyscan_" + QLocale::system().name(),
		    QLibraryInfo::location(QLibraryInfo::TranslationsPath)
		    );
    app.installTranslator(&translator);

    //
    //  Create and launch xyscan
    //
    xyscanWindow win;
    app.installEventFilter(&win);
    win.show();
    return app.exec();
}