Apply fix from merge conflict to moved code

This commit is contained in:
David Rowe 2016-10-04 11:02:14 +13:00
parent caf1a93354
commit 3242a7884c

View file

@ -988,6 +988,8 @@ static bool equals(const QByteArray& byteArray, const uint8_t* ptr) {
}
void OffscreenQmlSurface::synthesizeKeyPress(QString key) {
auto eventHandler = getEventHandler();
if (eventHandler) {
auto utf8Key = key.toUtf8();
int scanCode = (int)utf8Key[0];
@ -1011,8 +1013,9 @@ void OffscreenQmlSurface::synthesizeKeyPress(QString key) {
QKeyEvent* pressEvent = new QKeyEvent(QEvent::KeyPress, scanCode, Qt::NoModifier, keyString);
QKeyEvent* releaseEvent = new QKeyEvent(QEvent::KeyRelease, scanCode, Qt::NoModifier, keyString);
QCoreApplication::postEvent(getEventHandler(), pressEvent);
QCoreApplication::postEvent(getEventHandler(), releaseEvent);
QCoreApplication::postEvent(eventHandler, pressEvent);
QCoreApplication::postEvent(eventHandler, releaseEvent);
}
}
void OffscreenQmlSurface::setKeyboardRaised(QObject* object, bool raised, bool numeric) {