Qt Code:
  1. QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE", "TEMP");
  2. db.setDatabaseName(dbName);
  3. if (db.open() && db.isOpenError()==false && db.isValid()==true)
  4. {
  5. // Opened
  6. }
  7. else
  8. {
  9. // Display error
  10. }
To copy to clipboard, switch view to plain text mode 

I'm letting the user pick a file on the harddrive to open as an SQLite database. But I can pick ANY file and it will always reach the opened block. How do I check that a file is a valid SQLite database file?

Thanks