Skip to content
Permalink
Browse files

Range Widget: Only enable for supported data types

And some doxymentation
  • Loading branch information
m-kuhn committed Aug 25, 2014
1 parent dddf895 commit 3d7d240b05a578cb234ffaab1dd4050557e8ea7b
@@ -107,6 +107,8 @@ class GUI_EXPORT QgsEditorWidgetFactory
* @param vl The layer
* @param fieldIdx The field index
* @return True if the type is supported for this field
*
* @see isFieldSupported( QgsVectorLayer* vl, ind fieldIdx )
*/
inline bool supportsField( QgsVectorLayer* vl, int fieldIdx ) { return isFieldSupported( vl, fieldIdx ); }

@@ -154,6 +156,8 @@ class GUI_EXPORT QgsEditorWidgetFactory
* @param vl
* @param fieldIdx
* @return True if the field is supported.
*
* @see supportsField( QgsVectorLayer* vl, fieldIdx )
*/
virtual bool isFieldSupported( QgsVectorLayer* vl, int fieldIdx );

@@ -60,7 +60,7 @@ void QgsRangeWidgetFactory::writeConfig( const QgsEditorWidgetConfig& config, QD
configElement.setAttribute( "Step", config["Step"].toInt() );
}

bool QgsRangeWidgetFactory::supportsField( QgsVectorLayer* vl, int fieldIdx )
bool QgsRangeWidgetFactory::isFieldSupported( QgsVectorLayer* vl, int fieldIdx )
{
switch ( vl->pendingFields()[fieldIdx].type() )
{
@@ -31,7 +31,7 @@ class GUI_EXPORT QgsRangeWidgetFactory : public QgsEditorWidgetFactory
virtual void writeConfig( const QgsEditorWidgetConfig& config, QDomElement& configElement, QDomDocument& doc, const QgsVectorLayer* layer, int fieldIdx );

private:
bool supportsField( QgsVectorLayer *vl, int fieldIdx );
virtual bool isFieldSupported( QgsVectorLayer *vl, int fieldIdx );
};

#endif // QGSRANGEWIDGETFACTORY_H

0 comments on commit 3d7d240

Please sign in to comment.
You can’t perform that action at this time.