【发布时间】:2020-11-29 02:23:19
【问题描述】:
我有一个QComboBox 和一个弹出列表(QAbstractItemView),显示不同的项目(QStandardItems)。现在,我希望列表中的项目显示与选中项目不同的文本。
背景:
I am creating a word-processor like style chooser where one can choose, say, "1.1 Heading 2" from the list, indicating the numbering and the style name, but when an item is chosen the combobox should only show the style名称,说“标题 2”。
我认为以下问题正是我所要求的,但显然选择了一个不起作用的答案(显然甚至根据提问者的说法):Can a QComboBox display a different value than whats in it's list?
【问题讨论】: