1 #ifndef PINYINBAR_H 2 #define PINYINBAR_H 3 4 #include <QListView> 5 6 class QStringListModel; 7 class QLabel; 8 class PinyinBar: public QWidget 9 { 10 Q_OBJECT 11 public: 12 explicit PinyinBar(QWidget *parent = Q_NULLPTR); 13 void setStringList(const QStringList &data, const QString &spellingBuf=QString()); 14 int count(); 15 Q_SIGNALS: 16 void textChose(const QString &text, int index); 17 18 private: 19 QStringListModel *m_model; 20 QLabel *m_pinyinLbl; 21 }; 22 23 24 #endif // PINYINBAR_H 25