Skip to content

Commit 3d7d240

Browse files
committed
Range Widget: Only enable for supported data types
And some doxymentation
1 parent dddf895 commit 3d7d240

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/gui/editorwidgets/core/qgseditorwidgetfactory.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ class GUI_EXPORT QgsEditorWidgetFactory
107107
* @param vl The layer
108108
* @param fieldIdx The field index
109109
* @return True if the type is supported for this field
110+
*
111+
* @see isFieldSupported( QgsVectorLayer* vl, ind fieldIdx )
110112
*/
111113
inline bool supportsField( QgsVectorLayer* vl, int fieldIdx ) { return isFieldSupported( vl, fieldIdx ); }
112114

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

src/gui/editorwidgets/qgsrangewidgetfactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void QgsRangeWidgetFactory::writeConfig( const QgsEditorWidgetConfig& config, QD
6060
configElement.setAttribute( "Step", config["Step"].toInt() );
6161
}
6262

63-
bool QgsRangeWidgetFactory::supportsField( QgsVectorLayer* vl, int fieldIdx )
63+
bool QgsRangeWidgetFactory::isFieldSupported( QgsVectorLayer* vl, int fieldIdx )
6464
{
6565
switch ( vl->pendingFields()[fieldIdx].type() )
6666
{

src/gui/editorwidgets/qgsrangewidgetfactory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class GUI_EXPORT QgsRangeWidgetFactory : public QgsEditorWidgetFactory
3131
virtual void writeConfig( const QgsEditorWidgetConfig& config, QDomElement& configElement, QDomDocument& doc, const QgsVectorLayer* layer, int fieldIdx );
3232

3333
private:
34-
bool supportsField( QgsVectorLayer *vl, int fieldIdx );
34+
virtual bool isFieldSupported( QgsVectorLayer *vl, int fieldIdx );
3535
};
3636

3737
#endif // QGSRANGEWIDGETFACTORY_H

0 commit comments

Comments
 (0)