Merge pull request #5061 from nouanda/fix16887

Fix #16887: creating a memory scratch layer with Z/M values does not add Z/M to the layer
This commit is contained in:
Nyall Dawson 2017-08-25 13:27:03 +10:00 committed by GitHub
commit 233f25abd9

View File

@ -47,20 +47,19 @@ QgsNodeEditorModel::QgsNodeEditorModel( QgsVectorLayer *layer, QgsSelectedFeatur
, mRCol( -1 )
{
if ( !mSelectedFeature->vertexMap().isEmpty() )
{
mHasZ = mSelectedFeature->vertexMap().at( 0 )->point().is3D();
mHasM = mSelectedFeature->vertexMap().at( 0 )->point().isMeasure();
QgsWkbTypes::Type layerWKBType = mLayer->wkbType();
if ( mHasZ )
mZCol = 2;
mHasZ = QgsWkbTypes::hasZ( layerWKBType );
mHasM = QgsWkbTypes::hasM( layerWKBType );
if ( mHasM )
mMCol = 2 + ( mHasZ ? 1 : 0 );
if ( mHasZ )
mZCol = 2;
if ( mHasR )
mRCol = 2 + ( mHasZ ? 1 : 0 ) + ( mHasM ? 1 : 0 );
}
if ( mHasM )
mMCol = 2 + ( mHasZ ? 1 : 0 );
if ( mHasR )
mRCol = 2 + ( mHasZ ? 1 : 0 ) + ( mHasM ? 1 : 0 );
QWidget *parentWidget = dynamic_cast< QWidget * >( parent );
if ( parentWidget )