1 Star 0 Fork 25

Linux-Gitee/Qtmxapp-desktop

forked from 韦东山/Qtmxapp-desktop 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.cpp 2.00 KB
一键复制 编辑 原始数据 按行查看 历史
世玉轩 提交于 2020-06-19 17:31 +08:00 . init push myir hmi v2.0 gui
#include <QApplication>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QFontDatabase>
#include "qmlplot.h"
#include "common.h"
#include "myfunction.h"
#include "translator.h"
#include "mvideooutput.h"
void iconFontInit()
{
//17171717fontawesome-webfont.ttf171717170017171717
//17171717:www.fontawesome.com.cn
//
int fontId_digital = QFontDatabase::addApplicationFont(":/fonts/DIGITAL/DS-DIGIB.TTF");
int fontId_fws = QFontDatabase::addApplicationFont(":/fonts/fontawesome-webfont.ttf"); //17171717171717Ʉ171717170017171717ID
QString fontName_fws = QFontDatabase::applicationFontFamilies(fontId_fws).at(0); //1717001717171717171717
QFont iconFont_fws;
iconFont_fws.setFamily(fontName_fws);
QApplication::setFont(iconFont_fws);
iconFont_fws.setPixelSize(20); //17171717171717171717
}
int main(int argc, char *argv[])
{
qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
QApplication app(argc, argv);
QQmlApplicationEngine engine;
// QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
// QGuiApplication app(argc, argv);
qmlRegisterType<GetSystemInfo>("GetSystemInfoAPI", 1, 0, "GetSystemInfo");
qmlRegisterType<CustomPlotItem>("CustomPlot", 1, 0, "CustomPlotItem");
qmlRegisterType<MyFunction>("MyFunction.module", 1, 0, "MyFunction");
qmlRegisterType<MVideoOutput>("mvideooutput",1,0, "MVideoOutput");
// qmlRegisterType<Translator>("translator", 1, 0, );
Translator *translator = Translator::getInstance();
translator->set_QQmlEngine(&engine);
engine.rootContext()->setContextProperty("translator",
translator);
//font icon init
iconFontInit();
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/linux-gitee/Qtmxapp-desktop.git
git@gitee.com:linux-gitee/Qtmxapp-desktop.git
linux-gitee
Qtmxapp-desktop
Qtmxapp-desktop
master

搜索帮助