Skip to content
Permalink
Browse files

Autocreate wrapper for date and relation editor widgets

Followup de547ad
  • Loading branch information
m-kuhn committed Jul 24, 2015
1 parent 39ad2b0 commit 20abb7d83e10040f8690d2da2a0e78acc6a218b9
@@ -90,3 +90,11 @@ QString QgsDateTimeEditFactory::representValue( QgsVectorLayer* vl, int fieldIdx

return result;
}

QMap<const char*, int> QgsDateTimeEditFactory::supportedWidgetTypes()
{
QMap<const char*, int> map = QMap<const char*, int>();
map.insert( QDateTimeEdit::staticMetaObject.className(), 10 );
map.insert( QgsDateTimeEdit::staticMetaObject.className(), 10 );
return map;
}
@@ -34,6 +34,7 @@ class GUI_EXPORT QgsDateTimeEditFactory : public QgsEditorWidgetFactory
QgsEditorWidgetConfig readConfig( const QDomElement &configElement, QgsVectorLayer *layer, int fieldIdx ) override;
void writeConfig( const QgsEditorWidgetConfig& config, QDomElement& configElement, QDomDocument& doc, const QgsVectorLayer* layer, int fieldIdx ) override;
QString representValue( QgsVectorLayer* vl, int fieldIdx, const QgsEditorWidgetConfig& config, const QVariant& cache, const QVariant& value ) const override;
virtual QMap<const char*, int> supportedWidgetTypes() override;
};

#endif // QGSDATETIMEEDITFACTORY_H
@@ -93,3 +93,10 @@ void QgsRelationReferenceFactory::writeConfig( const QgsEditorWidgetConfig& conf
filterFields.setAttribute( "ChainFilters", config["ChainFilters"].toBool() );
}
}

QMap<const char*, int> QgsRelationReferenceFactory::supportedWidgetTypes()
{
QMap<const char*, int> map = QMap<const char*, int>();
map.insert( QgsRelationReferenceWidget::staticMetaObject.className(), 10 );
return map;
}
@@ -75,6 +75,8 @@ class GUI_EXPORT QgsRelationReferenceFactory : public QgsEditorWidgetFactory
*/
virtual void writeConfig( const QgsEditorWidgetConfig& config, QDomElement& configElement, QDomDocument& doc, const QgsVectorLayer* layer, int fieldIdx ) override;

virtual QMap<const char*, int> supportedWidgetTypes() override;

private:
QgsAttributeEditorContext mEditorContext;
QgsMapCanvas* mCanvas;

1 comment on commit 20abb7d

@3nids

This comment has been minimized.

Copy link
Member

@3nids 3nids commented on 20abb7d Jul 24, 2015

thanks!

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