Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果没有子类化,我是否可以在 QComboBox 中显示未进行选择的文本,例如 QLineEdit 中的 setPlaceholderText?
QComboBox 没有占位符文本选项,但您可以通过两种方式实现:
myCombo->lineEdit()->setPlaceholderText("Some text");