how to configure QT for Sqlcipher

42 Views Asked by At

i'm using sqlcipher in cli mode on windows and it works very well. now i'm trying to integrate it into my QT 6.6 project, but it won't work. I've tried adding the following config to my .pro file

INCLUDEPATH += C:/CODE/QT/sqlcipher/src
LIBS += C:/CODE/QT/sqlcipher/sqlite3.lib
DEFINES += SQLITE_HAS_CODEC

hier is my QT code for connecting to sqlcipher

QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName(mydb.sqlite);
db.open().
QSqlQuery query;
query.exec("PRAGMA KEY='ma_phrase_secrete';");

but the sql database created with this code can be accessed on sqlitestudio without a password, so the encryption didn't work

0

There are 0 best solutions below