1 Star 1 Fork 8

圆月庄主/QmlInputMethod

forked from LukeLee/QmlInputMethod 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
qmlhelper.cpp 750 Bytes
一键复制 编辑 原始数据 按行查看 历史
MrEO 提交于 2018-01-04 11:55 . changed some interface
#include "qmlhelper.h"
#include <QGuiApplication>
#include <QEvent>
#include <QWindow>
#include <QKeyEvent>
#include <QDebug>
#include <QQuickItem>
QmlHelper::QmlHelper(QObject *parent) : QObject(parent)
{
}
QString QmlHelper::getClassName(QObject *object) const
{
return object ? object->metaObject()->className() : "";
}
void QmlHelper::keyClickUpper(int key) const
{
qApp->postEvent(qApp->focusWindow(),
new QKeyEvent(QKeyEvent::KeyPress, key, Qt::ShiftModifier, QChar(key).toUpper()));
}
QPointF QmlHelper::getAbsolutePos(QQuickItem *object) const
{
if (!object) {
return QPointF(0, 0);
}
QPointF currentPos(object->position());
return getAbsolutePos(object->parentItem()) + currentPos;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/yanshinghwang/QmlInputMethod.git
git@gitee.com:yanshinghwang/QmlInputMethod.git
yanshinghwang
QmlInputMethod
QmlInputMethod
master

搜索帮助