ui -> tablica -> item(i, j) -> text().toInt(&f1);
if(f1)
{
ui -> tablica -> item(i, j) -> setBackgroundColor(Qt::white);
}
方法 setBackgroundColor 出錯。
uj5u.com熱心網友回復:
使用:void QTableWidgetItem::setBackground(const QBrush &brush)
看看這里為什么:
https://doc.qt.io/qt-5/qtablewidgetitem-obsolete.html#setBackgroundColor
void QTableWidgetItem::setBackgroundColor(const QColor &color) 此函式已過時。提供它是為了保持舊的源代碼作業。我們強烈建議不要在新代碼中使用它。此功能已棄用。請改用 setBackground()。另見 backgroundColor()。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/385766.html
下一篇:Rails,模型和資料庫一樣嗎?
