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.
我在 Qt IDE 中有 ComboBox,在这个组合框中列出了员工的姓名。但它会不时出现新名称,有些会被删除。所以我想我可以制作一个这样的文本文件:
name 1 name 2 name 3 name 4 name 5 //and you keep going on
如何在组合框中获取此列表?
如果您试图在组合框中获取每个项目,您可以像这样迭代:
for(int i = 0; i < ui->comboBox->count(); ++i) { qDebug() << ui->comboBox->itemText(i); }