Is there a Qt helper function to fill a vector<string> from a QListBox (and vice versa) or do I need to write something like:
// Filling a vector<string> from a QListBox widget. // dialog_->databaseLB is of type QListBox*. vector<string> contents; for (unsigned int i = 0; i < dialog_->databaseLB->count(); ++i) { string const line = fromqstr(dialog_->databaseLB->text(i)); contents.push_back(line); } // Filling a QListBox widget from a vector<string> // dialog_->databaseLB is of type QListBox*. vector<string> db = ...; vector<string>::const_iterator it = db.begin(); vector<string>::const_iterator end = db.end(); dialog_->databaseLB->clear(); for (; it != end; ++it) { dialog_->databaseLB->insertItem(toqstr(*it)); } -- Angus