#ifndef EXPERTLISTWIDGET_H #define EXPERTLISTWIDGET_H #include class QFUser; class QVBoxLayout; class QListWidget; class QListWidgetItem; /// /// \brief The ExpertListWidget class /// 专家列表 class ExpertListWidget : public QWidget { Q_OBJECT public: explicit ExpertListWidget(QWidget *parent = nullptr); void showUsers(const QList &list); bool hasSelectedItem() const; int selectedRow() const; void clearSelection(); signals: void signalSelectionChanged(); void siganlItemDoubleClicked(int row); private: void initialize(); void initLayout(); void connectSignalsAndSlots(); private slots: void slotItemDoubleClicked(QListWidgetItem *item); void slotItemClicked(QListWidgetItem *item); void slotCurrentItemChanged(QListWidgetItem *current, QListWidgetItem *previous); void slotCurrentRowChanged(int currentRow); void slotItemSelectionChanged(); private: QVBoxLayout *m_vBoxLayout = nullptr; QListWidget *m_listWidget = nullptr; }; #endif // EXPERTLISTWIDGET_H