You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

fellowlistwidget.h 1.1 kB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef FELLOWLISTWIDGET_H
  2. #define FELLOWLISTWIDGET_H
  3. #include "feiqlib/feiqmodel.h"
  4. #include <QListWidget>
  5. //1.按“会话中”,“有新消息”、“在线”、“离线”优先级罗列好友信息
  6. //2.支持查询好友
  7. class FellowListWidget : public QObject
  8. {
  9. Q_OBJECT
  10. public:
  11. typedef std::function<int (const Fellow&, const Fellow&)> RankPredict;
  12. FellowListWidget();
  13. void bindTo(QListWidget* widget);
  14. public:
  15. void update(const Fellow& fellow);
  16. void top(const Fellow& fellow);
  17. void topSecond(const Fellow& fellow);
  18. void mark(const Fellow& fellow, const QString &info);
  19. void setRankPredict(RankPredict predict);
  20. signals:
  21. void select(const Fellow* fellow);
  22. private slots:
  23. void itemChosen(QListWidgetItem *item);
  24. private:
  25. QString fellowText(const Fellow& fellow);
  26. QListWidgetItem* findFirstItem(const Fellow& fellow);
  27. int requestRow(const Fellow& fellow);
  28. const Fellow* getFellow(const QListWidgetItem* item);
  29. private:
  30. RankPredict mRankPredict;
  31. QListWidget* mWidget;
  32. };
  33. #endif // FELLOWLISTWIDGET_H

mac下的“飞秋”大多数只是飞鸽传书协议,而且未发现令人满意的开源项目,所以基于c++与qt实现了基础的飞秋协议。

Contributors (1)