//返回最靠近的整数
qRound(amount*100/total);
QTableWidget:
//设置交替行底色变动
ui->tableWidget->setAlternatingRowColors(true);
//横向舒展单元格,铺满屏幕
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
//只写模式如果无文件会主动创立
if(!dataFile.open(QIODevice::WriteOnly)){
qDebug()<<"文件关上失败"<<dataFile.errorString()
<<QDir::currentPath()<<dataFile.fileName();
}
dataFile.close();
发表回复