Qt - 如何在 QComboBox 中使用富文本?
我试图在 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为 自定义委托类 就是答案。解决方案是简单地将标准绘图例程替换为您自己的例程(使用即 QLabel)。这里有一个类似的问题:QListView/QListWidget with custom items and custom item widgets
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