ProjectListWidget.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef PROJECTLISTWIDGET_H
  2. #define PROJECTLISTWIDGET_H
  3. #include <QWidget>
  4. class PushButton;
  5. class ToolButton;
  6. class LineEdit;
  7. class TreeWidget;
  8. class QVBoxLayout;
  9. class QHBoxLayout;
  10. class QLabel;
  11. class QListWidget;
  12. class QListWidgetItem;
  13. class ProjectListItemWidget : public QWidget
  14. {
  15. Q_OBJECT
  16. public:
  17. explicit ProjectListItemWidget(QWidget *parent = nullptr);
  18. void initialize();
  19. void initLayout();
  20. void setIndex(int index);
  21. int index() const;
  22. void setName(const QString name);
  23. const QString name() const;
  24. private:
  25. int m_index;
  26. QString m_name;
  27. QHBoxLayout *m_hBoxLayout = nullptr;
  28. QVBoxLayout *m_vBoxLayout = nullptr;
  29. QLabel *m_indexLabel = nullptr;
  30. QLabel *m_nameLabel = nullptr;
  31. QLabel *m_typeLabel1 = nullptr;
  32. QLabel *m_typeLabel2 = nullptr;
  33. };
  34. /// 工程列表
  35. class ProjectListWidget : public QWidget
  36. {
  37. Q_OBJECT
  38. public:
  39. explicit ProjectListWidget(QWidget *parent = nullptr);
  40. void refreshList();
  41. private:
  42. void initialize();
  43. void initLayout();
  44. void connectSiganlsAndSlots();
  45. private slots:
  46. void slotItemDoubleClicked(QListWidgetItem *item);
  47. void slotItemClicked(QListWidgetItem *item);
  48. void slotCurrentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
  49. void slotCurrentRowChanged(int currentRow);
  50. void slotItemSelectionChanged();
  51. signals:
  52. private:
  53. QVBoxLayout *m_vBoxLayout = nullptr;
  54. // QListWidget *m_listWidget = nullptr;
  55. TreeWidget *m_treeWidget = nullptr;
  56. };
  57. #endif // PROJECTLISTWIDGET_H