123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #ifndef PINYINHELPER_H
- #define PINYINHELPER_H
- #include <QObject>
- #include <QStringList>
- class DialogSoftKeyboard;
- class QLabel;
- class PinYinHelper : public QObject
- {
- Q_OBJECT
- public:
- explicit PinYinHelper(QObject *parent = 0);
- private:
- DialogSoftKeyboard *input;
- //当前拼音索引
- int pinyinIndex;
- //当前显示的汉字标签的数量
- int pinyinCount;
- //所有拼音链表
- QStringList pinyinAll;
- //拼音字母
- QString pinyin;
- //固定数量汉字标签数组(硬键盘展示用)
- QList<QLabel *>labCh;
- //顶部汉字标签数组
- QList<QLabel *>labCn;
- //更多汉字标签数组
- QList<QLabel *>labMore;
- public slots:
- void setInput(DialogSoftKeyboard *input);
- void setLabs(QList<QLabel *>labCh, QList<QLabel *>labCn, QList<QLabel *>labMore);
- //移动到合适的位置
- void movePosition();
- //查询汉字
- void selectChinese(const QString &pinyin);
- //显示查询到的汉字
- void showChinese();
- //上下翻页显示汉字
- void showPrevious();
- void showNext();
- //计算当前汉字长度自动隐藏标签
- void checkChinese(const QString &pinyin);
- void setChVisible(int index);
- //清空当前汉字信息
- void clearChinese();
- void hideChinese();
- };
- #endif // PINYINHELPER_H
|