我正在使用 Qt 5.12。我想一次从组合框中删除所有项目。是否有任何程序可以一次删除所有项目而不用一个一个地删除一个索引。
最佳答案
如果你看一下https://doc.qt.io/qt-5/qcombobox.html您将看到函数 clear()
。
功能说明:
“Clears the combobox, removing all items. Note: If you have set an external model on the combobox this model will still be cleared when calling this function.”
关于c++ - 如何删除QComboBox的所有内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56005849/