先设置滚动条平滑,然后再设置滚动条滚动到底部
QTableWidget *TableWidgetChat;//聊天表
TableWidgetChat->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);//设置平滑一点
/*.....表定义略*/
int t=TableWidgetChat->verticalScrollBar()->maximum();
TableWidgetChat->verticalScrollBar()->setValue(t);//设置滚动条滚动到最大值