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.
AppFlow/FITK_Component/FITKWidget/FITKTableWidget.h

160 lines
4.8 KiB
C

/**
*
* @file FITKTableWidget.h
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*
*/
#ifndef FITKTableWidget_H_
#define FITKTableWidget_H_
#include <QTableWidget>
#include "FITKWidgetAPI.h"
namespace Comp
{
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
class FITKWidgetAPI FITKTableWidget :public QTableWidget
{
Q_OBJECT;
public:
/**
* @brief Construct a new FITKTableWidget object
* @param[i] parent My Param doc
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
FITKTableWidget(QWidget* parent);
/**
* @brief Destroy the FITKTableWidget object
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
virtual ~FITKTableWidget();
/**
* @brief true
* @param[i] isAppend true false
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
void setAppendLineByEnterPressed(bool isAppend);
/**
* @brief false
* @param[i] isAlone true false
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
void setIsAloneRow(bool isAlone);
protected slots:
;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
virtual void cutCurrentData();
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
virtual void copyCurrentData();
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
virtual void pasteCurrentData();
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
virtual void insertRowBefore();
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
virtual void insertRowAfter();
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
virtual void deleteTableRows();
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
virtual void clearContents();
/**
* @brief tableWidget
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
virtual void clearTable();
/**
* @brief
* @param[i] pos My Param doc
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
virtual void handleContextMenu(const QPoint& pos);
protected:
/**
* @brief
* @param[i] event
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
virtual void keyPressEvent(QKeyEvent *event) override;
/**
* @brief
* @param[i] event
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
virtual void keyReleaseEvent(QKeyEvent *event) override;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
virtual bool edit(const QModelIndex &index, EditTrigger trigger = QAbstractItemView::SelectedClicked, QEvent *event = nullptr) override;
/**
* @brief
* @param[i] row
* @author BaGuijun (baguijun@163.com)
* @date 2024-06-07
*/
virtual void insertNewRow(int row);
protected:
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-04-22
*/
QString _copyValue = "";
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-04-22
*/
bool _isAddLineByEnter = true;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-04-22
*/
bool _isAloneRow = false;
};
}
#endif