[QGIS-Developer] Creating QOCISPATIAL driver for QtSql

Julien Cabieces julien.cabieces at oslandia.com
Thu Mar 18 06:18:19 PDT 2021


Hi,

Here is how you create a database with the QOCISPATIAL driver
https://github.com/qgis/QGIS/blob/master/src/providers/oracle/qgsoracleconn.cpp#L78

Then, you just have to pass this object to a QSqlQuery object and here
you go!

For the build process of the driver, I think you can try building from the existing CMakeList
in the ocispatial folder, it should do just fine.

Then be carefull that the driver is well loaded by your program. You can
just add it in Qt plugins/sqldriver folder, or define it in qt.conf or
with QT_PLUGIN_PATH (see
https://doc.qt.io/qt-5/deployment-plugins.html).

Regards,
Julien


> Hello,
>
>  
>
> when i visited
> https://github.com/qgis/QGIS/blob/master/src/providers/oracle/ocispatial/qsq
> l_ocispatial.cpp I learned, that it is possible to create an QOCISPATIAL
> driver which can be used with QtSql. Unfortunately I failed to create the
> corresponding DLL file without compiling the whole QGis project.
>
>  
>
> At the moment I am looking for an instruction which shows how to create the
> QOCISPATIAL driver (and not the entire project). Especially I am interested
> how Qt identifies the driver which is located in \plugins\sqldrivers.
>
>  
>
> Thanks in advance
>
> Peter
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer



More information about the QGIS-Developer mailing list