File tree Expand file tree Collapse file tree 6 files changed +18
-1
lines changed Expand file tree Collapse file tree 6 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,11 @@ class QgsDataProvider : QObject
6666 */
6767 virtual bool setSubsetString(QString subset);
6868
69+ /**
70+ * provider supports setting of subset strings
71+ * @note added in 1.4
72+ */
73+ virtual bool supportsSubsetString();
6974
7075 /**
7176 * Returns the subset definition string (typically sql) currently in
Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ void QgsVectorLayerProperties::reset( void )
438438 // on the builder. If the ability to enter a query directly into the box is required,
439439 // a mechanism to check it must be implemented.
440440 txtSubsetSQL->setEnabled ( false );
441- pbnQueryBuilder->setEnabled ( true );
441+ pbnQueryBuilder->setEnabled ( layer && layer-> dataProvider () && layer-> dataProvider ()-> supportsSubsetString () );
442442
443443 // get field list for display field combo
444444 const QgsFieldMap& myFields = layer->pendingFields ();
Original file line number Diff line number Diff line change @@ -121,6 +121,12 @@ class CORE_EXPORT QgsDataProvider : public QObject
121121 }
122122
123123
124+ /* *
125+ * provider supports setting of subset strings
126+ * @note added in 1.4
127+ */
128+ virtual bool supportsSubsetString () { return false ; }
129+
124130 /* *
125131 * Returns the subset definition string (typically sql) currently in
126132 * use by the layer and used by the provider to limit the feature set.
Original file line number Diff line number Diff line change @@ -95,6 +95,8 @@ class QgsOgrProvider : public QgsVectorDataProvider
9595 /* * Accessor for sql where clause used to limit dataset */
9696 virtual QString subsetString ();
9797
98+ virtual bool supportsSubsetString () { return true ; }
99+
98100 /* * mutator for sql where clause used to limit dataset size */
99101 virtual bool setSubsetString ( QString theSQL );
100102
Original file line number Diff line number Diff line change @@ -255,6 +255,8 @@ class QgsPostgresProvider : public QgsVectorDataProvider
255255 /* * mutator for sql where clause used to limit dataset size */
256256 bool setSubsetString ( QString theSQL );
257257
258+ virtual bool supportsSubsetString () { return true ; }
259+
258260 /* *Returns a bitmask containing the supported capabilities*/
259261 int capabilities () const ;
260262
Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ class QgsSpatiaLiteProvider: public QgsVectorDataProvider
8181 /* * mutator for sql where clause used to limit dataset size */
8282 virtual bool setSubsetString ( QString theSQL );
8383
84+ virtual bool supportsSubsetString () { return true ; }
85+
8486 /* * Select features based on a bounding rectangle. Features can be retrieved with calls to nextFeature.
8587 * @param fetchAttributes list of attributes which should be fetched
8688 * @param rect spatial filter
You can’t perform that action at this time.
0 commit comments