title: QTableWidget change border color and mouse cursor to a specific cell when event occured
body: <p>How can I change QTableWidget border color and mouse cursor to a specific cell(QTableWidgetItem), not the entire table?</p>
  <p>It looks like I have to use a QStyledItemDelegate, but I don't know how to apply a stylesheet. I want to change the border of a specific cell when a specific event occurs (eg, when a specific button is clicked), but it is too difficult.</p>
  <pre><code>self.tblWgt = QTableWidget()
  self.tblWgt.setStyleSheet('''
  QTableView:item {
      border: 1px solid red;
  }
  ''') # change whole cell style
  self.tblWgt.setCursor(QCursor(Qt.CursorShape.PointingHandCursor)) # change whole cell mouse cursor
  
  item = QTableWidgetItem()
  item.setStyleSheet() # does not exist
  
  class Delegate(QStyledItemDelegate):
    def paint(self, painter, option, index):
      super().paint(painter, option, index)
      option.widget.style().setStyleSheet()  &lt;&lt;&lt; # does not exist
  
  self.tblWgt.setItemDelegateForColumn(2, Delegate())
  
  
  def BorderChange(self):
    item.setStyleSheet() # does not exist
    # How to change a specific cell border using a delegate? I want to use stylesheet
  
  self.btn1 = QPushButton(self)
  self.btn1.setText(&quot;Border change button&quot;)
  self.btn1.clicked.connect(self.BorderChange)
  
  </code></pre>