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.

162 lines
4.6 KiB
C

/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
#ifndef LOCKERWIDGET_H
#define LOCKERWIDGET_H
#include "FITK_Kernel/FITKCore/FITKAbstractGUI.h"
#include "FITKWidgetAPI.h"
class QVBoxLayout;
class QScrollArea;
namespace Comp
{
class FITKDrawerWidget;
class FITKLockerButton;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
class FITKWidgetAPI FITKLockerWidget :public Core::FITKWidget
{
Q_OBJECT;
public:
/**
* @brief Construct a new FITKLockerWidget object
* @param[i] id ID
* @param[i] parent
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
FITKLockerWidget(int id, FITKDrawerWidget* parent = nullptr);
/**
* @brief Destroy the FITKLockerWidget object
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
~FITKLockerWidget();
/**
* @brief
* @param[i] text
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
void setText(const QString& text);
/**
* @brief
* @param[i] widget
* @param[i] isStretch true-false-
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
void addWidget(QWidget* widget, bool isStretch = false);
/**
* @brief ID
* @return int ID
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
int getID();
/**
* @brief
* @param[i] fold true-false-
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
void setFoldable(bool fold);
/**
* @brief
* @return true
* @return false
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
bool getFoldable();
/**
* @brief
* @param[i] pixmap
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
void setFoldPixmap(const QPixmap& foldImage);
/**
* @brief
* @param[i] pixmap
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
void setUnFoldPixmap(const QPixmap& unFoldImage);
signals:
;
/**
* @brief
* @param[i] id ID
* @param[i] fold true-false-
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
void foldWidgetSig(int id, bool fold);
private:
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
void initialize();
private:
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
bool m_fold;
/**
* @brief id
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
int m_id = -1;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
QPixmap m_foldPixmap;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
QPixmap m_unfoldPixmap;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
QWidget* m_widget = nullptr;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
QVBoxLayout* m_widgetLayout = nullptr;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
FITKLockerButton* m_button = nullptr;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-05
*/
QScrollArea* m_scrollArea = nullptr;
};
}
#endif // LOCKERWIDGET_H