Seamly2D
Code documentation
main.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * *
3  * Copyright (C) 2017 Seamly, LLC *
4  * *
5  * https://github.com/fashionfreedom/seamly2d *
6  * *
7  ***************************************************************************
8  **
9  ** Seamly2D is free software: you can redistribute it and/or modify
10  ** it under the terms of the GNU General Public License as published by
11  ** the Free Software Foundation, either version 3 of the License, or
12  ** (at your option) any later version.
13  **
14  ** Seamly2D is distributed in the hope that it will be useful,
15  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  ** GNU General Public License for more details.
18  **
19  ** You should have received a copy of the GNU General Public License
20  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
21  **
22  **************************************************************************
23 
24  ************************************************************************
25  **
26  ** @file main.cpp
27  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
28  ** @date 10 7, 2015
29  **
30  ** @brief
31  ** @copyright
32  ** This source code is part of the Valentine project, a pattern making
33  ** program, whose allow create and modeling patterns of clothing.
34  ** Copyright (C) 2015 Seamly2D project
35  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
36  **
37  ** Seamly2D is free software: you can redistribute it and/or modify
38  ** it under the terms of the GNU General Public License as published by
39  ** the Free Software Foundation, either version 3 of the License, or
40  ** (at your option) any later version.
41  **
42  ** Seamly2D is distributed in the hope that it will be useful,
43  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
44  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45  ** GNU General Public License for more details.
46  **
47  ** You should have received a copy of the GNU General Public License
48  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
49  **
50  *************************************************************************/
51 
52 /*
53  * @brief entry point of SeamlyMe application
54  * @return non-zero value is code of the error
55  */
56 
57 #include "tmainwindow.h"
58 #include "mapplication.h"
59 
60 #include <QMessageBox> // For QT_REQUIRE_VERSION
61 #include <QTimer>
62 
63 int main(int argc, char *argv[])
64 {
65  Q_INIT_RESOURCE(seamlymeicon);
66  Q_INIT_RESOURCE(theme);
67  Q_INIT_RESOURCE(icon);
68  Q_INIT_RESOURCE(schema);
69  Q_INIT_RESOURCE(flags);
70 
71  QT_REQUIRE_VERSION(argc, argv, "5.15.2");
72 
73  //------------------------------------------------------------------------
74  // On macOS, correct WebView / QtQuick compositing and stacking requires running
75  // Qt in layer-backed mode, which again requires rendering on the Gui thread.
76  qWarning("SeamlyME: Setting QT_MAC_WANTS_LAYER=1 and QSG_RENDER_LOOP=basic");
77  qputenv("QT_MAC_WANTS_LAYER", "1");
78  //------------------------------------------------------------------------
79 
80 #ifndef Q_OS_MAC // supports natively
81  InitHighDpiScaling(argc, argv);
82 #endif //Q_OS_MAC
83 
84  MApplication app(argc, argv);
85  app.InitOptions();
86 
87  QTimer::singleShot(0, &app, SLOT(ProcessCMD()));
88 
89  return app.exec();
90 }
int main(int argc, char *argv[])
Definition: main.cpp:67
void InitOptions()
void InitHighDpiScaling(int argc, char *argv[])
Definition: def.cpp:551