feat: QTableWidget
只是调整改项目代码的注释和风格样式,没有功能性的变化或者修复
This commit is contained in:
parent
d8676a8ebe
commit
72135d010c
@ -28,6 +28,7 @@ ExQTableWidget::~ExQTableWidget()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//为某一行创建items
|
||||||
void ExQTableWidget::createItemsARow(int row, QString name, QString sex, QDate birth, QString nation, int score, bool isAnime)
|
void ExQTableWidget::createItemsARow(int row, QString name, QString sex, QDate birth, QString nation, int score, bool isAnime)
|
||||||
{
|
{
|
||||||
QTableWidgetItem* item = nullptr;
|
QTableWidgetItem* item = nullptr;
|
||||||
|
@ -15,12 +15,12 @@ class ExQTableWidget : public QMainWindow
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
enum cellType { //自定义表格单元格TYPE的类型,创建item时使用
|
enum cellType { //自定义表格单元格TYPE的类型,创建item时使用
|
||||||
ctName,
|
ctName, //姓名
|
||||||
ctSex,
|
ctSex, //性别
|
||||||
ctBirth,
|
ctBirth, //出生日期
|
||||||
ctNation,
|
ctNation, //籍贯
|
||||||
ctScore,
|
ctScore, //分数
|
||||||
ctLikeAnime
|
ctLikeAnime //是否喜欢二次元
|
||||||
};
|
};
|
||||||
|
|
||||||
enum fieldColNum { //自定义各个表段在表格中的列号
|
enum fieldColNum { //自定义各个表段在表格中的列号
|
||||||
@ -39,37 +39,22 @@ public:
|
|||||||
void createItemsARow(int row, QString name, QString sex, QDate birth, QString nation, int score, bool isAnime); //为某一行创建items
|
void createItemsARow(int row, QString name, QString sex, QDate birth, QString nation, int score, bool isAnime); //为某一行创建items
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_btnSetHeader_clicked();
|
void on_btnSetHeader_clicked(); //设置表头
|
||||||
|
void on_btnInitTable_clicked(); //初始化数据表
|
||||||
void on_btnInitTable_clicked();
|
void on_btnSetRow_clicked(); //设置表格的行数
|
||||||
|
void on_btnInsertRow_clicked(); //插入行
|
||||||
void on_btnSetRow_clicked();
|
void on_btnAddRow_clicked(); //在最后一行添加一行
|
||||||
|
void on_btnDelRow_clicked(); //删除当前行
|
||||||
void on_btnInsertRow_clicked();
|
void on_btnAutoHeight_clicked(); //自动设置行高
|
||||||
|
void on_btnAutoWidth_clicked(); //自动设置列高
|
||||||
void on_btnAddRow_clicked();
|
void on_btnReadToEdit_clicked(); //读取表格内容到文本
|
||||||
|
void on_chkBoxHeadEdit_clicked(bool checked); //表格可编辑模式
|
||||||
void on_btnDelRow_clicked();
|
void on_chkBoxRowColor_clicked(bool checked); //间隔行底色
|
||||||
|
void on_chkBoxHeadRow_clicked(bool checked); //显示行表头
|
||||||
void on_btnAutoHeight_clicked();
|
void on_chkBoxHeadCol_clicked(bool checked); //显示列表头
|
||||||
|
void on_radioBtnSelectItem_clicked(); //单元格选择
|
||||||
void on_btnAutoWidth_clicked();
|
void on_radioBtnSelectRow_clicked(); //行选择
|
||||||
|
void on_tableWidget_currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn); //获取当前item和前一个(点击)item的行列号
|
||||||
void on_btnReadToEdit_clicked();
|
|
||||||
|
|
||||||
void on_chkBoxHeadEdit_clicked(bool checked);
|
|
||||||
|
|
||||||
void on_chkBoxRowColor_clicked(bool checked);
|
|
||||||
|
|
||||||
void on_chkBoxHeadRow_clicked(bool checked);
|
|
||||||
|
|
||||||
void on_chkBoxHeadCol_clicked(bool checked);
|
|
||||||
|
|
||||||
void on_radioBtnSelectItem_clicked();
|
|
||||||
|
|
||||||
void on_radioBtnSelectRow_clicked();
|
|
||||||
|
|
||||||
void on_tableWidget_currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::ExQTableWidget *ui;
|
Ui::ExQTableWidget *ui;
|
||||||
|
Loading…
Reference in New Issue
Block a user