Skip to content

Commit

Permalink
Make sure a widget is initialized when creating a widget wrapper
Browse files Browse the repository at this point in the history
Fix #10357
  • Loading branch information
m-kuhn committed May 27, 2014
1 parent 644dd13 commit 37c1cad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/gui/editorwidgets/core/qgseditorwidgetregistry.cpp
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/core/qgswidgetwrapper.cpp
Expand Up @@ -62,7 +62,7 @@ const QgsEditorWidgetConfig QgsWidgetWrapper::config()
return mConfig;
}

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

0 comments on commit 37c1cad

Please sign in to comment.