#includeQComboBox *comboBox = new QComboBox; comboBox->addItem("Item 1"); comboBox->addItem("Item 2"); comboBox->addItem("Item 3");
#includeIn this example, 10 items are added to the QComboBox using a loop and the addItem() method along with QString. Package library: Qt.QComboBox *comboBox = new QComboBox; for(int i=0; i<10; i++) { comboBox->addItem(QString("Item %1").arg(i+1)); }