Thank you for your suggestion wysota.
I extracted the relevant bits of code and tested this threadless morsel:
int main(int argc, char *argv[])
{
db.setHostName("localhost");
db.setDatabaseName("mythconverg");
bool trashok;
db.
setPort(QString("3306").
toInt(&trashok
));
db.setUserName("mythtv");
db.setPassword("mythtv");
bool ok = db.open();
if (ok) qDebug() << "Open OK";
else qDebug() << "Open failed";
amodel.setQuery("SELECT sourceid FROM videosource"); //BANG! SIGSEGV
...
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("localhost");
db.setDatabaseName("mythconverg");
bool trashok;
db.setPort(QString("3306").toInt(&trashok));
db.setUserName("mythtv");
db.setPassword("mythtv");
bool ok = db.open();
if (ok) qDebug() << "Open OK";
else qDebug() << "Open failed";
QSqlQueryModel amodel;
amodel.setQuery("SELECT sourceid FROM videosource"); //BANG! SIGSEGV
...
}
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.
Bookmarks