为什么我也设置了行数、行高,并且设置的信息也可以获取到,但窗口还是不显示设置的信息,请问这是为什么啊?
```c++
#include "bank_stuff.h"
#include "bankpushbutton.h"
#include "staff_function.h"
#include <QLabel>
#include <QMessageBox>
#include <QTableWidgetItem>
#include <QStringList>
#include <QPainter>
#include <QPropertyAnimation>
#include <QDebug>
bank_Stuff::bank_Stuff(QWidget *parent) : QTableWidget(parent)
{
//设置窗口标题
this->setWindowTitle("财大银行");
//设置窗口图标
this->setWindowIcon(QIcon(":/icon.jpg"));
//设置窗口大小
this->resize(400,600);
//获取staffColumn
creatStaffLink();
//设置整体布局:行数,列数
int column=2;
this->setRowCount(staffColumn);
this->setColumnCount(column);
qDebug()<<"行 this->rowCount()="<<this->rowCount()<<endl;//行 this->rowCount()= 3
qDebug()<<"列 this->columnCount()="<<this->columnCount()<<endl;//列 this->columnCount()= 2
//设置每列的宽度都为该窗口二分之一
this->setColumnWidth(0,this->width()/2);
this->setColumnWidth(1,this->width()/2);
//设置行高
for(int i=0;i<staffColumn;i++)
this->setRowHeight(i,this->height()/5);
//设置列标签
QStringList header;
header<<"姓名"<<"电话";
this->setHorizontalHeaderLabels(header);
this->setItem(0,0,new QTableWidgetItem("张飞"));
this->setItem(1,0,new QTableWidgetItem("关羽"));
this->setItem(2,0,new QTableWidgetItem("吕布"));
this->setItem(0,1,new QTableWidgetItem("35"));
this->setItem(1,1,new QTableWidgetItem("36"));
this->setItem(2,1,new QTableWidgetItem("32"));
QString str = this->item(0,0)->text();
qDebug()<<"str="<<str<<endl;//str= "张飞"
//设置竖直滚动条
this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
void bank_Stuff::paintEvent(QPaintEvent *event)
{
//绘制背景图片
QPainter painter(this);
QPixmap pix(":/background.jpg");
painter.drawPixmap(0,0,this->width(),this->height(),pix);
}
```