git-svn-id: http://svn.osgeo.org/qgis/trunk@11861 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
jef 2009-10-28 00:51:34 +00:00
parent 7dc2cd13aa
commit f130f103c7
6 changed files with 18 additions and 1 deletions

View File

@ -66,6 +66,11 @@ class QgsDataProvider : QObject
*/
virtual bool setSubsetString(QString subset);
/**
* provider supports setting of subset strings
* @note added in 1.4
*/
virtual bool supportsSubsetString();
/**
* Returns the subset definition string (typically sql) currently in

View File

@ -438,7 +438,7 @@ void QgsVectorLayerProperties::reset( void )
// on the builder. If the ability to enter a query directly into the box is required,
// a mechanism to check it must be implemented.
txtSubsetSQL->setEnabled( false );
pbnQueryBuilder->setEnabled( true );
pbnQueryBuilder->setEnabled( layer && layer->dataProvider() && layer->dataProvider()->supportsSubsetString() );
//get field list for display field combo
const QgsFieldMap& myFields = layer->pendingFields();

View File

@ -121,6 +121,12 @@ class CORE_EXPORT QgsDataProvider : public QObject
}
/**
* provider supports setting of subset strings
* @note added in 1.4
*/
virtual bool supportsSubsetString() { return false; }
/**
* Returns the subset definition string (typically sql) currently in
* use by the layer and used by the provider to limit the feature set.

View File

@ -95,6 +95,8 @@ class QgsOgrProvider : public QgsVectorDataProvider
/** Accessor for sql where clause used to limit dataset */
virtual QString subsetString();
virtual bool supportsSubsetString() { return true; }
/** mutator for sql where clause used to limit dataset size */
virtual bool setSubsetString( QString theSQL );

View File

@ -255,6 +255,8 @@ class QgsPostgresProvider : public QgsVectorDataProvider
/** mutator for sql where clause used to limit dataset size */
bool setSubsetString( QString theSQL );
virtual bool supportsSubsetString() { return true; }
/**Returns a bitmask containing the supported capabilities*/
int capabilities() const;

View File

@ -81,6 +81,8 @@ class QgsSpatiaLiteProvider: public QgsVectorDataProvider
/** mutator for sql where clause used to limit dataset size */
virtual bool setSubsetString( QString theSQL );
virtual bool supportsSubsetString() { return true; }
/** Select features based on a bounding rectangle. Features can be retrieved with calls to nextFeature.
* @param fetchAttributes list of attributes which should be fetched
* @param rect spatial filter