123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #ifndef EXPERTLISTWIDGET_H
- #define EXPERTLISTWIDGET_H
- #include <QWidget>
- 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<QFUser *> &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
|