Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid some deprecated warnings
  • Loading branch information
nyalldawson committed Nov 24, 2015
1 parent 3624d7b commit cac9c9e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/core/qgsvectorlayer.cpp
Expand Up @@ -2754,10 +2754,10 @@ void QgsVectorLayer::setEditType( int idx, EditType type )

Q_NOWARN_DEPRECATED_PUSH
const QString widgetType = QgsLegacyHelpers::convertEditType( type, cfg, this, mUpdatedFields[idx].name() );
Q_NOWARN_DEPRECATED_POP

setEditorWidgetV2( idx, widgetType );
setEditorWidgetV2Config( idx, cfg );
Q_NOWARN_DEPRECATED_POP
}

void QgsVectorLayer::setAnnotationForm( const QString& ui )
Expand All @@ -2767,28 +2767,36 @@ void QgsVectorLayer::setAnnotationForm( const QString& ui )

QMap< QString, QVariant > QgsVectorLayer::valueMap( int idx )
{
Q_NOWARN_DEPRECATED_PUSH
return editorWidgetV2Config( idx );
Q_NOWARN_DEPRECATED_POP
}

QgsVectorLayer::RangeData QgsVectorLayer::range( int idx )
{
Q_NOWARN_DEPRECATED_PUSH
const QgsEditorWidgetConfig cfg = editorWidgetV2Config( idx );
return RangeData(
cfg.value( "Min" ),
cfg.value( "Max" ),
cfg.value( "Step" )
);
Q_NOWARN_DEPRECATED_POP
}

QString QgsVectorLayer::dateFormat( int idx )
{
Q_NOWARN_DEPRECATED_PUSH
return editorWidgetV2Config( idx ).value( "DateFormat" ).toString();
Q_NOWARN_DEPRECATED_POP
}

QSize QgsVectorLayer::widgetSize( int idx )
{
Q_NOWARN_DEPRECATED_PUSH
const QgsEditorWidgetConfig cfg = editorWidgetV2Config( idx );
return QSize( cfg.value( "Width" ).toInt(), cfg.value( "Height" ).toInt() );
Q_NOWARN_DEPRECATED_POP
}

void QgsVectorLayer::setRendererV2( QgsFeatureRendererV2 *r )
Expand Down Expand Up @@ -2859,10 +2867,12 @@ void QgsVectorLayer::destroyEditCommand()

void QgsVectorLayer::setCheckedState( int idx, const QString& checked, const QString& unchecked )
{
Q_NOWARN_DEPRECATED_PUSH
QgsEditorWidgetConfig cfg = editorWidgetV2Config( idx );
cfg["CheckedState"] = checked;
cfg["UncheckedState"] = unchecked;
setEditorWidgetV2Config( idx, cfg );
Q_NOWARN_DEPRECATED_POP
}

int QgsVectorLayer::fieldNameIndex( const QString& fieldName ) const
Expand Down

0 comments on commit cac9c9e

Please sign in to comment.