我使用 method1 在 qtablewidget 行中查找一些文本。方法一:
def FindItem(self):
items = self.SuraBRS.findItems(
self.SearchTbox.text(), QtCore.Qt.MatchContains)
if items:
results = '\n'.join(
'row %d column %d' % (item.row() + 1, item.column() + 1)
for item in items)
else:
results = 'Found Nothing'
print(results)
Run Code Online (Sandbox Code Playgroud)
现在我想知道如何突出显示结果或更改其颜色。我想选择并突出显示该文本或字符,而不是所有行或列。