- Configuration CMake
add_subdirectory(QSql) # in your project file CMakeFiles.txt
...
target_link_libraries(... QSqlplugin)
- In main cpp
#include <QSql/include/sqlplugin.h>
...
qmlRegisterType<SqlPlugin>("QSql",1,0,"SqlDriver"); // insert it after engine declaration