#ifndef NMGUIDRAWERWIDGET_H #define NMGUIDRAWERWIDGET_H #include "nmGUI_global.h" #include #include #include #include class NM_GUI_EXPORT nmGUIDrawerWidget : public QWidget { Q_OBJECT public: explicit nmGUIDrawerWidget(const QString &sTitle, QWidget *parent = nullptr); void initUI(); // 折叠控制 void setExpanded(bool expanded); bool isExpanded() const; // 内容区域 void setContentLayout(QLayout *layout); // 设置样式 void setStyleSheet(const QString &style); signals: void expansionChanged(bool expanded); private slots: void toggleExpand(); private: bool m_bExpanded; // 折叠状态 QString m_sTitle; // 标题 QHBoxLayout *m_pHeaderLayout; // 标题栏布局 QToolButton *m_pToggleButton; // 折叠按钮 QLabel* m_pTitleLabel; // 标题标签 QWidget *m_pWidgetContent; // 内容区域 }; #endif // NMGUIDRAWERWIDGET_H