myinputpanelcontext.h 865 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef MYINPUTPANELCONTEXT_H
  2. #define MYINPUTPANELCONTEXT_H
  3. #include <QInputContext>
  4. //#include "myinputpanel.h"
  5. class MyInputPanel;
  6. class InputMethod;
  7. class MyInputPanelContext : public QInputContext
  8. {
  9. Q_OBJECT
  10. public:
  11. MyInputPanelContext();
  12. ~MyInputPanelContext();
  13. //输入事件过滤
  14. bool filterEvent(const QEvent* event);
  15. //返回输入方式的识别码
  16. QString identifierName();
  17. //返回输入编码方式
  18. QString language();
  19. //输入是否发送完
  20. bool isComposing() const;
  21. void reset();
  22. private slots://发送接收到的字符到有光标焦点的窗口
  23. void sendCharacter(QChar character);
  24. void sendStr(QString str);
  25. private://更新软键盘位置
  26. void updatePosition();
  27. private:
  28. //MyInputPanel *inputPanel;
  29. InputMethod *inputPanel;
  30. };
  31. #endif // MYINPUTPANELCONTEXT_H