Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

dtkApplication.h 1.09 KB
Newer Older
Julien Wintz's avatar
Julien Wintz committed
1 2 3
// Version: $Id$
//
//
4

Julien Wintz's avatar
Julien Wintz committed
5 6 7
// Commentary:
//
//
8

Julien Wintz's avatar
Julien Wintz committed
9 10 11 12 13
// Change Log:
//
//

// Code:
14 15 16

#pragma once

17
#include <dtkWidgetsExport.h>
18
#include <dtkLog>
19

Julien Wintz's avatar
Julien Wintz committed
20 21
#include <QtCore>
#include <QtWidgets>
22

23 24 25
class dtkApplicationPrivate;

class DTKWIDGETS_EXPORT dtkApplication: public QApplication
26 27
{
public:
Julien Wintz's avatar
Julien Wintz committed
28
             dtkApplication(int& argc, char **argv);
29 30 31
    virtual ~dtkApplication(void);

public:
32
    virtual void initialize(void);
33

34 35
public:
    virtual bool noGui(void);
36

37
public:
38
    static dtkApplication *create(int& argc, char *argv[]) {
Julien Wintz's avatar
Julien Wintz committed
39
        for (int i = 0; i < argc; i++) {
40
            if (!qstrcmp(argv[i], "-nw") || !qstrcmp(argv[i], "--nw") ||  !qstrcmp(argv[i], "-no-window") || !qstrcmp(argv[i], "--no-window") || !qstrcmp(argv[i], "-h") || !qstrcmp(argv[i], "--help") || !qstrcmp(argv[i], "--version")) {
41 42
                qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("minimal"));
            }
Julien Wintz's avatar
Julien Wintz committed
43
        }
44

45 46 47 48 49 50
        return new dtkApplication(argc, argv);
    }

public:
    QCommandLineParser  *parser(void);
    QSettings         *settings(void);
51

52 53 54
protected:
    dtkApplicationPrivate *d;
};
55

Julien Wintz's avatar
Julien Wintz committed
56 57
//
// dtkApplication.h ends here