title: How to check database is exist or not?
body: <p>I am using sqlite database in qt. Database created when i use setDatabase("") function. But i dont know how to check same database is exist or not. Here is my code:</p>
  
  <pre><code>//add database driver
      db = QSqlDatabase::addDatabase ("QSQLITE");
  
      //create database
      if(db.databaseName () == db_Name){
          qDebug() &lt;&lt; "Database exist or not created." &lt;&lt; endl;
      } else {
          db.setDatabaseName (db_Name);
          qDebug() &lt;&lt; "Database created." &lt;&lt; endl;
      }
  
      //opening connection
      db.open ();
  
      //if connection created
      if(db.isOpen ()){
          qDebug() &lt;&lt; "Database connected." &lt;&lt; endl;
      } else {
          qDebug() &lt;&lt; "Database not connected." &lt;&lt; endl;
      }
  </code></pre>
  
  <p>I get the Database created. message. How to check ? Thanks.</p>