First of all the command that you point out should throw you an error since the QTableWidgetItem does not have the setStyleSheet () method.
On the other hand the Qt Style Sheets can not be applied to specific items pointing coordinates, you can apply it to certain items that you have certain states such as pressed , selected , etc.
Because of the above, we discard the use of qss, QTableWidgetItem has methods to indicate the colors of the text and background using the methods setForeground()
and setBackground()
, respectively.
Example:
from PyQt5 import QtCore, QtGui, QtWidgets
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
table = QtWidgets.QTableWidget(10, 10)
it = QtWidgets.QTableWidgetItem("hola mundo")
it.setForeground(QtGui.QColor("red"))
it.setBackground(QtGui.QColor("orange"))
table.setItem(0, 0, it)
table.show()
sys.exit(app.exec_())