1 Star 1 Fork 8

LukeLee/QmlInputMethod

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.cpp 900 Bytes
一键复制 编辑 原始数据 按行查看 历史
MrEO 提交于 2018-01-04 11:55 . changed some interface
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include "inputcore.h"
#include "qmlhelper.h"
static QObject *inputCoreInstance(QQmlEngine *qmlengine, QJSEngine * engine)
{
Q_UNUSED(qmlengine);
InputCore * ins = new InputCore(engine);
ins->listenClassNameList << "QQuickTextField" << "QQuickTextArea";
return ins;
}
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
qmlRegisterSingletonType<InputCore>(
"InputMethod", 1, 0,
"Input", inputCoreInstance);
QmlHelper qmlHelper;
engine.rootContext()->setContextProperty("helper", &qmlHelper);
engine.load(QUrl(QLatin1String("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/luke47/QmlInputMethod.git
git@gitee.com:luke47/QmlInputMethod.git
luke47
QmlInputMethod
QmlInputMethod
master

搜索帮助