There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -84,13 +84,23 @@ void QgsFieldModel::layerDeleted() | ||
|
||
void QgsFieldModel::updateModel() | ||
{ | ||
beginResetModel(); | ||
mExpression = QList<QString>(); | ||
if ( mLayer ) | ||
mFields = mLayer->pendingFields(); | ||
{ | ||
if ( mFields.toList() != mLayer->pendingFields().toList() ) | ||
{ | ||
beginResetModel(); | ||
mFields = mLayer->pendingFields(); | ||
endResetModel(); | ||
} | ||
else | ||
emit dataChanged( index(0, 0 ), index( rowCount(), 0 )); | ||
} | ||
else | ||
{ | ||
beginResetModel(); | ||
mFields = QgsFields(); | ||
endResetModel(); | ||
beginResetModel(); | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
NathanW2
via email
Author
Member
|
||
} | ||
|
||
void QgsFieldModel::setAllowExpression( bool allowExpression ) | ||
3 comments
on commit 7d9b8dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't reset the expression anymore.
is this intentional?
I am not sure it's the best behavior.
I suppose changing the layer should remove the expression too.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, thanks!
2x beginResetModel()?