You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

163 lines
4.7 KiB
C

/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
#ifndef DRAWERWIDGET_H
#define DRAWERWIDGET_H
#include "FITKWidgetAPI.h"
#include "FITK_Kernel/FITKCore/FITKAbstractGUI.h"
#include <QList>
namespace Ui {
class FITKDrawerWidget;
}
namespace Core {
class FITKWidget;
}
namespace Comp
{
class FITKLockerWidget;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
class FITKWidgetAPI FITKDrawerWidget : public Core::FITKWidget
{
Q_OBJECT;
public:
/**
* @brief Construct a new FITKDrawerWidget object
* @param[i] parent My Param doc
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
explicit FITKDrawerWidget(QWidget *parent = nullptr);
/**
* @brief Destroy the FITKDrawerWidget object
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
virtual ~FITKDrawerWidget();
/**
* @brief locker
* @param[i] fold My Param doc
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-12
*/
void setAllItemFold(bool fold);
/**
* @brief
* @param[i] expand
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
void setItemExpand(bool expand);
/**
* @brief
* @return true
* @return false
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
bool getItemExpand();
/**
* @brief
* @param[i] widget
* @param[i] title
* @param[i] isStretch
* @int id
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
virtual int addWidget(QWidget* widget, QString title, bool isStretch = false);
/**
* @brief
* @param id id
* @return FITKLockerWidget*
* @since 1.0.0
*/
FITKLockerWidget* getLockerWidgetByID(int id);
/**
* @brief locker
* @param[i] foldImage
* @param[i] unFoldImage
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-12
*/
void setLockerWidgetIcon(const QPixmap& foldImage, const QPixmap& unFoldImage);
protected:
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
virtual void initialize();
private slots:
;
/**
* @brief
* @param[i] id id
* @param[i] fold
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
void foldWidget(int id, bool fold);
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
void removeLastCompStretch();
private:
/**
* @brief ID
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
static int m_widgetNum;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
bool m_itemExpand = false ;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
Ui::FITKDrawerWidget *m_ui = nullptr;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
QList<FITKLockerWidget*> m_LockerWidgetList = {};
/**
* @brief locker
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-12
*/
bool m_allItemFold{ false };
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-12
*/
QPixmap m_foldImage;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-12
*/
QPixmap m_unFoldImage;
};
}
#endif // DRAWERWIDGET_H