예제 #1
0
void KeypadInputMethod::preedit(const QString &str) {
  if (str.isNull()) {
    preedit(QString(1, currentChar()));
  } else {
    sendPreeditString(str, str.size());
    _state = COMPOSING;
  }
}
void SyszuxIM::preeditString(QString newString)   //发送预处理字符
{
    /*
    if (newString == "Backspace") {
     if (inputString.length() == 0 ) {                                  //如果没有预处理字符,删除已有数据
    QWSServer::sendKeyEvent(0x01000003 , Qt::Key_Backspace , Qt::NoModifier , true ,false);
    } else {                                                                //删除预处理中的字符
         inputString.resize(inputString.length() - 1);
         this->sendPreeditString(inputString , 0);
        }
    } else {                                                                //显示预处理字符
        inputString += newString;
        sendPreeditString(inputString ,0);
    }*/

    sendPreeditString(newString ,0);
}