Idea is to inherit QStyledItemDelegate, rewrite the paint method, using painter. FillRect background, reoccupy painter. DrawText draw string,
Now plans to use the find a search string, found after painting the background color, but the find returns the position of the string, not to draw the background color of the rectangular coordinates, could you tell me how can get the accurate coordinates, thank you!
CodePudding user response:
Use pyqt5