void MyInputPanelContext
::sendCharacter(QChar character
) {
QPointer<QWidget> w = focusWidget();
if (!w)
return;
if (character == 'C')
{
return;
}
if (!w)
return;
}
void MyInputPanelContext::sendCharacter(QChar character)
{
QPointer<QWidget> w = focusWidget();
if (!w)
return;
if (character == 'C')
{
QKeyEvent delPress(QEvent::KeyPress, Qt::Key_Delete,Qt::NoModifier, QString(character));
QKeyEvent delRelease(QEvent::KeyRelease, Qt::Key_Delete,Qt::NoModifier, QString());
QApplication::sendEvent(w, &delPress);
QApplication::sendEvent(w, &delRelease);
return;
}
QKeyEvent keyPress(QEvent::KeyPress, character.unicode(), Qt::NoModifier, QString(character));
QApplication::sendEvent(w, &keyPress);
if (!w)
return;
QKeyEvent keyRelease(QEvent::KeyPress, character.unicode(), Qt::NoModifier, QString());
QApplication::sendEvent(w, &keyRelease);
}
To copy to clipboard, switch view to plain text mode
Bookmarks