获取pyqt5上Combobox项目的主题名称
我想在Qt5-Tools Designer中输入的combobox项目的QT设计师中输入主题名称:
我已经尝试了以下代码:
def load_actions_tips(self):
combo = self.form.converter_action_choice
for i in range(combo.count()):
print(f"{combo.itemText(i) = }")
print(f"{combo.itemData(i) = }")
print(f"{combo.itemIcon(i).themeName = }")
print(f"{combo.itemIcon(i).themeName.__name__ = }")
print(f"{combo.itemIcon(i).themeName.__qualname__ = }")
print(f"{combo.itemIcon(i).themeName.__repr__ = }")
print(f"{combo.itemIcon(i).themeName.__str__ = }")
print(f"{combo.itemIcon(i).themeName.__text_signature__ = }")
print(f"{str(combo.itemIcon(i).themeName) = }")
print(f"{dir(combo.itemIcon(i).themeName) = }")
目的是将主题名称自动添加到Combobox的项目值,以允许某人添加QT的ComboBox的项目的'Tooltips'如上所述的设计师在这里。
这里的目标是使所选项目的变量等于“ Blablo”。
I would like to get theme name entered in QT designer of the item of a combobox entered like this into Qt5-tools designer:
I have try this code:
def load_actions_tips(self):
combo = self.form.converter_action_choice
for i in range(combo.count()):
print(f"{combo.itemText(i) = }")
print(f"{combo.itemData(i) = }")
print(f"{combo.itemIcon(i).themeName = }")
print(f"{combo.itemIcon(i).themeName.__name__ = }")
print(f"{combo.itemIcon(i).themeName.__qualname__ = }")
print(f"{combo.itemIcon(i).themeName.__repr__ = }")
print(f"{combo.itemIcon(i).themeName.__str__ = }")
print(f"{combo.itemIcon(i).themeName.__text_signature__ = }")
print(f"{str(combo.itemIcon(i).themeName) = }")
print(f"{dir(combo.itemIcon(i).themeName) = }")
The goal of this is to add the theme name to the item value of the combobox automatically in order to permit someone to add 'tooltips' of an item of a combobox from QT designer as described here.
The goal here is to get the variable equal to 'blablo' for the selected item.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论