QTableView 设置表格属性时,如列宽,必须先setModel()
//first
tableView->setModel(model);
//then
tableView->setColumnWidth(0, 100);
否则设置属性无效
\\设置颜色相间
tableView.setAlternatingRowColors(true);
tableView.setStyleSheet("QTableView{background-color: rgb(255, 255, 255);"
"alternate-background-color: lightgray;}");
引用自 http://blog.csdn.net/woshiwlia/article/details/9141065