Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt - How to use rich text in a QComboBox?

I am trying to use rich text in a QComboBox but it does not support it. Perhaps I should write a subclass? But I am unsure on what I would need to override as I have never done anything like this before. Please help. Thanks!

like image 248
Aaron McKellar Avatar asked Nov 06 '22 15:11

Aaron McKellar


1 Answers

I think custom delegate class is the answer. The solution is to simply replace standard drawing routine with your own (using i.e. QLabel). There was a similar question here: QListView/QListWidget with custom items and custom item widgets

like image 82
Mike Hordecki Avatar answered Nov 15 '22 07:11

Mike Hordecki