Will it change anything if you get rid of this line?
python Code:
  1. self.initStyleOption(options, index)
To copy to clipboard, switch view to plain text mode