forked from KangLin/RabbitIm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
executable file
·65 lines (58 loc) · 1.96 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include "MainWindow.h"
#include "Widgets/FrmVideo/FrmPlayer.h"
#include "Global/Global.h"
#include "Tool.h"
#include <QDebug>
#include <QApplication>
#include <QTranslator>
#ifdef RABBITIM_USE_LIBCURL
#include "Update/DownLoadHandle.h"
#endif
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setApplicationName("RabbitIm");
a.setOrganizationName("KangLin studio");
//QFontDatabase::addApplicationFont("://DejaVuSans.ttf");
//a.setFont(QFont(DejaVuSans));
LOG_MODEL_DEBUG("main", "font:%s;codec:%s",
a.font().family().toStdString().c_str(),
QTextCodec::codecForLocale()->name().data());
//设置插件路径(msvc 下没有用)
a.addLibraryPath(CGlobal::Instance()->GetDirApplication());
a.addLibraryPath(CGlobal::Instance()->GetDirApplication()
+ QDir::separator() + "plugins");
CTool::SetFFmpegLog();
//*
MainWindow w;
#ifndef MOBILE
//加载窗口位置
QSettings conf(CGlobal::Instance()->GetApplicationConfigureFile(),
QSettings::IniFormat);
QScreen *pScreen = QGuiApplication::primaryScreen();
int top = conf.value("UI/MainWindow/top",
(pScreen->availableGeometry().height() - w.height()) >> 1).toInt();
int left = conf.value("UI/MainWindow/left",
(pScreen->availableGeometry().width() - w.width()) >> 1).toInt();
int Width = conf.value("UI/MainWindow/width", w.geometry().width()).toInt();
int Height = conf.value("UI/MainWindow/height",
w.geometry().height()).toInt();
w.resize(Width, Height);
w.move(left, top);
#endif
w.show();
#ifdef RABBITIM_USE_LIBCURL
//检查版本更新
CDownLoadHandleVersionFile update;
update.Start();
#endif
//*/
/*以下为视频捕获、显示测试代码(CFrmPlayer::TestCamera())
#ifdef DEBUG
CFrmPlayer player;
player.TestCamera();
player.show();
#endif
//*/
return a.exec();
}