Skip to content

Commit

Permalink
Use layer type instead of first vertex type
Browse files Browse the repository at this point in the history
  • Loading branch information
c-marcel committed Aug 23, 2017
1 parent c5371b6 commit 018c13a
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/app/nodetool/qgsnodeeditor.cpp
Expand Up @@ -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 )
Expand Down

0 comments on commit 018c13a

Please sign in to comment.