Skip to content
Permalink
Browse files

Make sure a widget is initialized when creating a widget wrapper

Fix #10357
  • Loading branch information
m-kuhn committed May 27, 2014
1 parent 644dd13 commit 37c1cad11a3d8a65ec1984a4229f725a000b8e96
@@ -44,10 +44,14 @@ QgsEditorWidgetWrapper* QgsEditorWidgetRegistry::create( const QString& widgetId
if ( mWidgetFactories.contains( widgetId ) )
{
QgsEditorWidgetWrapper* ww = mWidgetFactories[widgetId]->create( vl, fieldIdx, editor, parent );

if ( ww )
{
ww->setConfig( config );
ww->setContext( context );
// Make sure that there is a widget created at this point
// so setValue() et al won't crash
ww->widget();
return ww;
}
}
@@ -62,7 +62,7 @@ const QgsEditorWidgetConfig QgsWidgetWrapper::config()
return mConfig;
}

const QgsAttributeEditorContext&QgsWidgetWrapper::context()
const QgsAttributeEditorContext& QgsWidgetWrapper::context()
{
return mContext;
}

0 comments on commit 37c1cad

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