Question

I'm completely new to Qt. Actually I'm trying to build an app, which stores it's data to an encrypted sqlite database file. Ok, I've build sqlcipher successfully and found the files under ./libs (I'm on a Mac). Where do I've to put the files in my Qt project for development, and later on, for deploy it with the app?

qDebug() << QSqlDatabase::drivers();

gives me

("QSQLITE", "QMYSQL", "QMYSQL3", "QODBC", "QODBC3", "QPSQL", "QPSQL7") 

Thanks in advance.

Was it helpful?

Solution

I don't think a driver for SQLCipher exists in Qt. You'll only get the default drivers, which include SQLite.

I know two options: you use sqlcipher with its C API like a normal library, link to your app and you're done. Or you create the driver yourself. Creating that driver should be pretty simple as it should be almost identical to the one for sqlite, being the API almost identical. Simply linking the sqlite driver to sqlcipher instead of sqlite should be enough.

I found this online that should help you. But there are probably also other useful resources. That seems to simply re-use the sqlite plugin, linking to sqlcipher.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top