-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
47 lines (41 loc) · 1.2 KB
/
main.cpp
File metadata and controls
47 lines (41 loc) · 1.2 KB
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
#include "IniConfig.h"
#include "mainwindow.h"
#include <QApplication>
#include <QLocale>
#include <QTranslator>
#include <QSharedMemory>
#include <QMessageBox>
void configRead(){
IniConfig::initialPath();
IniConfig a;
auto keys=a.allKeys();
if(!keys.contains("hotkey"))
a.setValue("hotkey",QKeySequence("Ctrl+Alt+Q"));
}
int main(int argc, char *argv[]){
//Q_INIT_RESOURCE(res);
qDebug()<<"QMemos start ";
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QApplication a(argc, argv);
QIcon appIcon(":/memos.png");
QApplication::setWindowIcon(appIcon);
QSharedMemory singleton(a.applicationName());
if(!singleton.create(1)) {
QMessageBox::about(nullptr,"Info","No second start.");
return -1;
}
QTranslator translator;
const QStringList uiLanguages = QLocale::system().uiLanguages();
for (const QString &locale : uiLanguages) {
const QString baseName = "QMemos_" + QLocale(locale).name();
if (translator.load(":/i18n/" + baseName)) {
a.installTranslator(&translator);
break;
}
}
// QuickMemo w;
configRead();
MainWindow w;
w.show();
return a.exec();
}