m_Database = QSqlDatabase::addDatabase( "QSQLITE", "db_gui" ); m_Database.setDatabaseName( ":memory:" ); m_Database.open(); QSqlQuery query( m_Database ); bool ret = query.exec( "create table test ( "SomeField int" ) );
m_Database = QSqlDatabase::cloneDatabase( QSqlDatabase::database( "db_gui" ), "db_background" ); m_Database.open(); QStringList t = m_Database.tables(); // здесь пусто
C++ (Qt)QSqlDatabase db = QSqlDatabase::database( "db_gui" );QStringList t = db.tables();