mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
parent
2c51dcb7e9
commit
2700bcd5dd
@ -37,7 +37,7 @@ QgsField QgsEditorWidgetWrapper::field()
|
|||||||
|
|
||||||
QgsEditorWidgetWrapper* QgsEditorWidgetWrapper::fromWidget( QWidget* widget )
|
QgsEditorWidgetWrapper* QgsEditorWidgetWrapper::fromWidget( QWidget* widget )
|
||||||
{
|
{
|
||||||
return widget->property( "EWV2Wrapper" ).value<QgsEditorWidgetWrapper*>();
|
return qobject_cast<QgsEditorWidgetWrapper*>( widget->property( "EWV2Wrapper" ).value<QgsWidgetWrapper*>() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsEditorWidgetWrapper::setFeature( const QgsFeature& feature )
|
void QgsEditorWidgetWrapper::setFeature( const QgsFeature& feature )
|
||||||
|
@ -31,7 +31,7 @@ QWidget* QgsWidgetWrapper::widget()
|
|||||||
if ( !mWidget )
|
if ( !mWidget )
|
||||||
{
|
{
|
||||||
mWidget = createWidget( mParent );
|
mWidget = createWidget( mParent );
|
||||||
mWidget->setProperty( "EWV2Wrapper", QVariant::fromValue( this ) );
|
mWidget->setProperty( "EWV2Wrapper", QVariant::fromValue<QgsWidgetWrapper*>( this ) );
|
||||||
initWidget( mWidget );
|
initWidget( mWidget );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,12 +41,6 @@ QWidget* QgsWidgetWrapper::widget()
|
|||||||
void QgsWidgetWrapper::setConfig( const QgsEditorWidgetConfig& config )
|
void QgsWidgetWrapper::setConfig( const QgsEditorWidgetConfig& config )
|
||||||
{
|
{
|
||||||
mConfig = config;
|
mConfig = config;
|
||||||
// If an editor widget was supplied, we can initialize this now
|
|
||||||
if ( mWidget )
|
|
||||||
{
|
|
||||||
mWidget->setProperty( "EWV2Wrapper", QVariant::fromValue( this ) );
|
|
||||||
initWidget( mWidget );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsWidgetWrapper::setContext( const QgsAttributeEditorContext& context )
|
void QgsWidgetWrapper::setContext( const QgsAttributeEditorContext& context )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user