@@ -22,14 +22,14 @@ typedef QVector<QVariant> QgsAttributes;
22
22
// Set the list elements.
23
23
for (int i = 0; i < sipCpp->size(); ++i)
24
24
{
25
- const QVariant& v = sipCpp->at(i);
25
+ QVariant* v = new QVariant( sipCpp->at(i) );
26
26
PyObject *tobj;
27
27
28
- if ( v. isNull() )
28
+ if ( v-> isNull() )
29
29
{
30
30
tobj = Py_None;
31
31
}
32
- else if ((tobj = sipConvertFromType(& v, sipType_QVariant,Py_None)) == NULL)
32
+ else if ((tobj = sipConvertFromType(v, sipType_QVariant,Py_None)) == NULL)
33
33
{
34
34
return NULL;
35
35
}
@@ -121,15 +121,15 @@ class QgsFeature
121
121
122
122
if (fieldIdx >= 0)
123
123
{
124
- const QVariant& v = sipCpp->attribute(fieldIdx);
124
+ QVariant& v = sipCpp->attribute(fieldIdx);
125
125
if ( v.isNull() )
126
126
sipRes = Py_None;
127
127
else
128
128
sipRes = sipConvertFromInstance( &v, sipClass_QVariant, Py_None );
129
129
}
130
130
else if( altfieldIdx >= 0 )
131
131
{
132
- const QVariant& v = sipCpp->attribute(altfieldIdx);
132
+ QVariant& v = sipCpp->attribute(altfieldIdx);
133
133
if ( v.isNull() )
134
134
sipRes = Py_None;
135
135
else
@@ -200,11 +200,11 @@ class QgsFeature
200
200
}
201
201
else
202
202
{
203
- const QVariant& v = attrs[a0];
204
- if ( v. isNull() )
203
+ QVariant* v = new QVariant( attrs[a0]) ;
204
+ if ( v-> isNull() )
205
205
sipRes = Py_None;
206
206
else
207
- sipRes = sipConvertFromInstance( & v, sipClass_QVariant, Py_None );
207
+ sipRes = sipConvertFromInstance( v, sipClass_QVariant, Py_None );
208
208
}
209
209
%End
210
210
@@ -218,7 +218,7 @@ class QgsFeature
218
218
}
219
219
else
220
220
{
221
- const QVariant& v = sipCpp->attribute(fieldIdx);
221
+ QVariant& v = sipCpp->attribute(fieldIdx);
222
222
if ( v.isNull() )
223
223
sipRes = Py_None;
224
224
else
@@ -258,7 +258,7 @@ class QgsFeature
258
258
{
259
259
if ( a1Wrapper == Py_None )
260
260
{
261
- sipCpp->setAttribute(a0, QVariant( QVariant::Int ) );
261
+ sipCpp->setAttribute(* a0, QVariant( QVariant::Int ) );
262
262
}
263
263
else
264
264
{
@@ -422,7 +422,7 @@ class QgsFeature
422
422
{
423
423
if ( a1Wrapper == Py_None )
424
424
{
425
- sipCpp->setAttribute(a0, QVariant( QVariant::Int ) );
425
+ sipCpp->setAttribute(* a0, QVariant( QVariant::Int ) );
426
426
}
427
427
else
428
428
{
@@ -463,7 +463,7 @@ class QgsFeature
463
463
}
464
464
else
465
465
{
466
- const QVariant& v = sipCpp->attribute(fieldIdx);
466
+ QVariant& v = sipCpp->attribute(fieldIdx);
467
467
if ( v.isNull() )
468
468
sipRes = Py_None;
469
469
else
0 commit comments