Home > Mobile >  How to solve the problem of QInputMethodEvent trigger twice?
How to solve the problem of QInputMethodEvent trigger twice?

Time:11-28

As title, such as WIN10 bringing Microsoft pinyin (code automatically embedded in textEdit), print in eventfilters QInputMethodEvent
CommitString content, the output will be two times, one is empty, another is the value of the contents of the screen, but other noncoding embedded input method and normal, will only print time,
Had different lead to two different types of input method, how to solve? Purpose is to let embedded encoding input method on triggers only once after screen, filter out the null values that event, or can I distinguish it (can't go through the empty value filtering, as normal text on the screen in the process of typing the value is null, the screen after also free value and normal, not good filtering)

CodePudding user response:

Empty, I guess that is intercepted in the program, you have submitted content is input method

CodePudding user response:

reference 1st floor dinjay response:
empty, I guess that is intercepted in the program, you have submitted content is input method

Input method on screen QInputMethodEvent event triggered twice, after Microsoft pinyin will be embedded into the text box (coding), other than the embedded input method do not have this problem,
QInputMethodEvent * ie=(QInputMethodEvent *) event;
QDebug () & lt; <"Ime commited:" & lt;
  •  Tags:  
  • Qt
  • Related