C++ (Qt)QSqlQuery query("SELECT country FROM artist");while (query.next()) { QApplication::processEvents(); QString country = query.value(0).toString(); doSomething(country);}