QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); //connecting
auto databasePath = qApp->applicationDirPath() + QStringLiteral("/literatura.sql"); //rewritten path
qDebug() << "database location:" << databasePath;
db.setDatabaseName(databasePath);
if(!db.open())
{
qDebug()<<"ERROR WITH DB!!";
}
else {qDebug()<<"Successful loading";} //error message