Skip to content
Permalink
Browse files
add pure virtual QgsAbstractDbTableModel::setSql
  • Loading branch information
3nids committed Nov 12, 2021
1 parent efb89f8 commit 93bdf53a00f8dd8a614b56ba2b4610023351c6af
@@ -39,6 +39,11 @@ Returns the index of the column used by default to filter the results (probably
virtual bool searchableColumn( int column ) const;
%Docstring
Returns if the column should be searchable at the given index
%End

virtual void setSql( const QModelIndex &index, const QString &sql ) = 0;
%Docstring
Sets an sql statement that belongs to a cell specified by a model index
%End
};

@@ -42,6 +42,9 @@ class CORE_EXPORT QgsAbstractDbTableModel : public QStandardItemModel

//! Returns if the column should be searchable at the given index
virtual bool searchableColumn( int column ) const {Q_UNUSED( column ) return true;}

//! Sets an sql statement that belongs to a cell specified by a model index
virtual void setSql( const QModelIndex &index, const QString &sql ) = 0;
};

#endif // QGSABSTRACTDBTABLEMODEL_H
@@ -46,7 +46,7 @@ class QgsOgrDbTableModel : public QgsAbstractDbTableModel
void addTableEntry( const Qgis::BrowserLayerType &layerType, const QString &tableName, const QString &uri, const QString &geometryColName, const QString &geometryType, const QString &sql );

//! Sets an sql statement that belongs to a cell specified by a model index
void setSql( const QModelIndex &index, const QString &sql );
void setSql( const QModelIndex &index, const QString &sql ) override;

//! Returns the number of tables in the model
int tableCount() const
@@ -62,7 +62,7 @@ class QgsDb2TableModel : public QgsAbstractDbTableModel
void addTableEntry( const QgsDb2LayerProperty &property );

//! Sets an sql statement that belongs to a cell specified by a model index
void setSql( const QModelIndex &index, const QString &sql );
void setSql( const QModelIndex &index, const QString &sql ) override;

/**
* Sets one or more geometry types to a row. In case of several types, additional rows are inserted.
@@ -77,7 +77,7 @@ class QgsHanaTableModel : public QgsAbstractDbTableModel
void addTableEntry( const QString &connName, const QgsHanaLayerProperty &property );

//! Sets an sql statement that belongs to a cell specified by a model index
void setSql( const QModelIndex &index, const QString &sql );
void setSql( const QModelIndex &index, const QString &sql ) override;

//! Returns the number of tables in the model
int tableCount() const { return mTableCount; }
@@ -59,7 +59,7 @@ class QgsMssqlTableModel : public QgsAbstractDbTableModel
void addTableEntry( const QgsMssqlLayerProperty &property );

//! Sets an sql statement that belongs to a cell specified by a model index
void setSql( const QModelIndex &index, const QString &sql );
void setSql( const QModelIndex &index, const QString &sql ) override;

/**
* Sets one or more geometry types to a row. In case of several types, additional rows are inserted.
@@ -44,7 +44,7 @@ class QgsOracleTableModel : public QgsAbstractDbTableModel
void addTableEntry( const QgsOracleLayerProperty &property );

//! Sets an sql statement that belongs to a cell specified by a model index
void setSql( const QModelIndex &index, const QString &sql );
void setSql( const QModelIndex &index, const QString &sql ) override;

//! Returns the number of tables in the model
int tableCount() const { return mTableCount; }
@@ -39,7 +39,7 @@ class QgsPgTableModel : public QgsAbstractDbTableModel
void addTableEntry( const QgsPostgresLayerProperty &property );

//! Sets an sql statement that belongs to a cell specified by a model index
void setSql( const QModelIndex &index, const QString &sql );
void setSql( const QModelIndex &index, const QString &sql ) override;

//! Returns the number of tables in the model
int tableCount() const { return mTableCount; }
@@ -43,7 +43,7 @@ class QgsSpatiaLiteTableModel: public QgsAbstractDbTableModel
//! Adds entry for one database table to the model
void addTableEntry( const QString &type, const QString &tableName, const QString &geometryColName, const QString &sql );
//! Sets an sql statement that belongs to a cell specified by a model index
void setSql( const QModelIndex &index, const QString &sql );
void setSql( const QModelIndex &index, const QString &sql ) override;

/**
* Sets one or more geometry types to a row. In case of several types, additional rows are inserted.

0 comments on commit 93bdf53

Please sign in to comment.