1 Star 1 Fork 8

xiaoyu_ebox / 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();
}
C++
1
https://gitee.com/xiaoyu_ebox_git/QmlInputMethod.git
git@gitee.com:xiaoyu_ebox_git/QmlInputMethod.git
xiaoyu_ebox_git
QmlInputMethod
QmlInputMethod
master

搜索帮助