How fix this : error: no member named 'setBackgroundColor' in 'QTableWidgetItem'?

How fix this : error: no member named 'setBackgroundColor' in 'QTableWidgetItem'?

ui -> tablica -> item(i, j) -> text().toInt(&f1);
               if(f1)
               {
                   ui -> tablica -> item(i, j) -> setBackgroundColor(Qt::white);
               }

方法 setBackgroundColor 出错。

使用:void QTableWidgetItem::setBackground(const QBrush &brush)

看这里为什么:

https://doc.qt.io/qt-5/qtablewidgetitem-obsolete.html#setBackgroundColor

void QTableWidgetItem::setBackgroundColor(const QColor &color) This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code. This function is deprecated. Use setBackground() instead. See also backgroundColor().