ProjectListWidget.h 1.5 KB

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