Skip to content

Commit 018c13a

Browse files
committed
Use layer type instead of first vertex type
1 parent c5371b6 commit 018c13a

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/app/nodetool/qgsnodeeditor.cpp

+10-11
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,19 @@ QgsNodeEditorModel::QgsNodeEditorModel( QgsVectorLayer *layer, QgsSelectedFeatur
4747
, mRCol( -1 )
4848
{
4949

50-
if ( !mSelectedFeature->vertexMap().isEmpty() )
51-
{
52-
mHasZ = mSelectedFeature->vertexMap().at( 0 )->point().is3D();
53-
mHasM = mSelectedFeature->vertexMap().at( 0 )->point().isMeasure();
50+
QgsWkbTypes::Type layerWKBType = mLayer->wkbType();
5451

55-
if ( mHasZ )
56-
mZCol = 2;
52+
mHasZ = QgsWkbTypes::hasZ( layerWKBType );
53+
mHasM = QgsWkbTypes::hasM( layerWKBType );
5754

58-
if ( mHasM )
59-
mMCol = 2 + ( mHasZ ? 1 : 0 );
55+
if ( mHasZ )
56+
mZCol = 2;
6057

61-
if ( mHasR )
62-
mRCol = 2 + ( mHasZ ? 1 : 0 ) + ( mHasM ? 1 : 0 );
63-
}
58+
if ( mHasM )
59+
mMCol = 2 + ( mHasZ ? 1 : 0 );
60+
61+
if ( mHasR )
62+
mRCol = 2 + ( mHasZ ? 1 : 0 ) + ( mHasM ? 1 : 0 );
6463

6564
QWidget *parentWidget = dynamic_cast< QWidget * >( parent );
6665
if ( parentWidget )

0 commit comments

Comments
 (0)