Thank you for your suggestion wysota.

I extracted the relevant bits of code and tested this threadless morsel:

Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication a(argc, argv);
  4. QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
  5. db.setHostName("localhost");
  6. db.setDatabaseName("mythconverg");
  7. bool trashok;
  8. db.setPort(QString("3306").toInt(&trashok));
  9. db.setUserName("mythtv");
  10. db.setPassword("mythtv");
  11. bool ok = db.open();
  12. if (ok) qDebug() << "Open OK";
  13. else qDebug() << "Open failed";
  14. amodel.setQuery("SELECT sourceid FROM videosource"); //BANG! SIGSEGV
  15. ...
  16. }
To copy to clipboard, switch view to plain text mode 

So then I reverted from the Qt 4.5.0 snapshot to 4.4.3. and setQuery then worked as advertised. I will try picking up the latest 4.5 snapshot tomorrow to see if that has fixed anything.