forked from JaDogg/expressPython
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
39 lines (28 loc) · 845 Bytes
/
main.cpp
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
#include <cmath>
#include "Python.h"
#include "UI/mainview.h"
#include <QApplication>
//snippet storage is static cause
//it it should be only created once
static Snippets *snip;
//main view is static so it can be shared
//and only created once
static MainView *mainView;
int main(int argc, char *argv[]) {
//need to set program details
QCoreApplication::setOrganizationName("Bhathiya");
QCoreApplication::setOrganizationDomain("simpll.info");
QCoreApplication::setApplicationName("expressPython");
//non modified arguments must be passed
QApplication app(argc, argv);
wchar_t name[] = L"expressPython";
Py_SetProgramName(name);
snip = new Snippets();
mainView = new MainView();
mainView->SetSnippets(snip);
mainView->show();
int result = app.exec();
delete snip;
delete mainView;
return result;
}