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.

102 lines
2.7 KiB
C

/**
*
* @file FITKTabWidget.h
* @brief Tab
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*
*/
#ifndef FITKTabWidget_H_
#define FITKTabWidget_H_
#include <QTableWidget>
#include <QProxyStyle>
#include "FITKWidgetAPI.h"
namespace Comp
{
enum class FITKTabWidgetType{
FITKTab_None, //QtabWidget样式
FITKTab_Fill, //填充样式
FITKTab_Auto, //自适应大小样式
};
/**
* @brief Tab
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
class FITKWidgetAPI FITKTabWidget :public QTabWidget
{
Q_OBJECT;
public:
/**
* @brief Construct a new FITKTabWidget object
* @param[i] parent My Param doc
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
FITKTabWidget(FITKTabWidgetType type = FITKTabWidgetType::FITKTab_None, QWidget* parent = nullptr);
/**
* @brief Destroy the FITKTabWidget object
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
virtual ~FITKTabWidget();
/**
* @brief tab
* @param[i] tabName tab
* @return int
* @author BaGuijun (baguijun@163.com)
* @date 2024-10-16
*/
int findTabIndex(QString tabName);
protected:
/**
* @brief
* @param[i] event
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-02
*/
void showEvent(QShowEvent * event);
/**
* @brief
* @param[i] event
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-02
*/
void resizeEvent(QResizeEvent * event);
private:
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-02
*/
void changeStyleSheet();
private:
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-02
*/
FITKTabWidgetType _type = FITKTabWidgetType::FITKTab_None;
};
class FITKTabBar : public QTabBar
{
Q_OBJECT;
public:
FITKTabBar(QWidget *parent = nullptr);
FITKTabBar();
protected:
/**
* @brief Tab
* @param[i] index Tab
* @return QSize
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-03
*/
QSize tabSizeHint(int index) const override;
};
}
#endif