File tree Expand file tree Collapse file tree 5 files changed +27
-0
lines changed
src/providers/spatialite/qspatialite Expand file tree Collapse file tree 5 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ cmake -DWITH_SERVER=ON \
1515 -DSUPPRESS_QT_WARNINGS=ON \
1616 -DENABLE_MODELTEST=ON \
1717 -DENABLE_PGTEST=ON \
18+ -DWITH_QSPATIALITE=ON \
1819 -DWITH_QWTPOLAR=OFF \
1920 -DWITH_APIDOC=ON \
2021 -DWITH_ASTYLE=ON \
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ cmake \
2929 -DSUPPRESS_QT_WARNINGS=ON \
3030 -DENABLE_MODELTEST=ON \
3131 -DENABLE_PGTEST=ON \
32+ -DWITH_QSPATIALITE=ON \
3233 -DWITH_QWTPOLAR=OFF \
3334 -DWITH_QTWEBKIT=OFF \
3435 -DWITH_APIDOC=ON \
Original file line number Diff line number Diff line change 6060#include < sqlite3.h>
6161#include < qgsslconnect.h>
6262
63+ #if QT_VERSION >= 0x050000
64+ Q_DECLARE_OPAQUE_POINTER (sqlite3*)
65+ Q_DECLARE_OPAQUE_POINTER(sqlite3_stmt*)
66+ #endif
6367Q_DECLARE_METATYPE (sqlite3*)
6468Q_DECLARE_METATYPE(sqlite3_stmt*)
6569
@@ -325,10 +329,12 @@ QSpatiaLiteResult::~QSpatiaLiteResult()
325329void QSpatiaLiteResult::virtual_hook (int id, void *data)
326330{
327331 switch (id) {
332+ #if QT_VERSION < 0x050000
328333 case QSqlResult::DetachFromResultSet:
329334 if (d->stmt )
330335 sqlite3_reset (d->stmt );
331336 break ;
337+ #endif
332338 default :
333339 QSqlCachedResult::virtual_hook (id, data);
334340 }
@@ -485,6 +491,14 @@ QSqlRecord QSpatiaLiteResult::record() const
485491 return d->rInf ;
486492}
487493
494+ #if QT_VERSION >= 0x050000
495+ void QSpatiaLiteResult::detachFromResultSet ()
496+ {
497+ if (d->stmt )
498+ sqlite3_reset (d->stmt );
499+ }
500+ #endif
501+
488502QVariant QSpatiaLiteResult::handle () const
489503{
490504 return QVariant::fromValue (d->stmt );
@@ -531,6 +545,9 @@ bool QSpatiaLiteDriver::hasFeature(DriverFeature f) const
531545 case BatchOperations:
532546 case EventNotifications:
533547 case MultipleResultSets:
548+ #if QT_VERSION >= 0x050000
549+ case CancelQuery:
550+ #endif
534551 return false ;
535552 }
536553 return false ;
Original file line number Diff line number Diff line change @@ -80,6 +80,9 @@ class QSpatiaLiteResult : public QSqlCachedResult
8080 int numRowsAffected ();
8181 QVariant lastInsertId () const ;
8282 QSqlRecord record () const ;
83+ #if QT_VERSION >= 0x050000
84+ void detachFromResultSet ();
85+ #endif
8386 void virtual_hook (int id, void *data);
8487
8588private:
Original file line number Diff line number Diff line change @@ -47,6 +47,9 @@ QT_BEGIN_NAMESPACE
4747
4848class QSpatiaLiteDriverPlugin : public QSqlDriverPlugin
4949{
50+ #if QT_VERSION >= 0x050000
51+ Q_PLUGIN_METADATA (IID " org.qgis.QSpatiaLiteDriverPlugin" )
52+ #endif
5053public:
5154 QSpatiaLiteDriverPlugin ();
5255
@@ -75,7 +78,9 @@ QStringList QSpatiaLiteDriverPlugin::keys() const
7578 return l;
7679}
7780
81+ #if QT_VERSION < 0x050000
7882Q_EXPORT_STATIC_PLUGIN (QSpatiaLiteDriverPlugin)
7983Q_EXPORT_PLUGIN2(qspatialite, QSpatiaLiteDriverPlugin)
84+ #endif
8085
8186QT_END_NAMESPACE
You can’t perform that action at this time.
0 commit comments