Skip to content

Commit

Permalink
init zm support in QgsAdvancedDigitzingDockWidgetBase
Browse files Browse the repository at this point in the history
  • Loading branch information
lbartoletti authored and nyalldawson committed Sep 12, 2021
1 parent c2897fa commit 5dbc3f6
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/gui/qgsadvanceddigitizingdockwidget.cpp
Expand Up @@ -812,7 +812,6 @@ bool QgsAdvancedDigitizingDockWidget::applyConstraints( QgsMapMouseEvent *e )

const QgsCadUtils::AlignMapPointOutput output = QgsCadUtils::alignMapPoint( e->originalMapPoint(), context );


const bool res = output.valid;
QgsPoint point = pointXYToPoint( output.finalMapPoint );
mSnappedSegment.clear();
Expand Down Expand Up @@ -1378,6 +1377,24 @@ void QgsAdvancedDigitizingDockWidget::enable()
mErrorLabel->hide();
mCadWidget->show();

QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mMapCanvas->currentLayer() );
if ( vlayer )
{

const QgsWkbTypes::Type type = vlayer->wkbType();
mRelativeZButton->setEnabled( QgsWkbTypes::hasZ( type ) );
mZLabel->setEnabled( QgsWkbTypes::hasZ( type ) );
mZLineEdit->setEnabled( QgsWkbTypes::hasZ( type ) );
mLockZButton->setEnabled( QgsWkbTypes::hasZ( type ) );
mRepeatingLockZButton->setEnabled( QgsWkbTypes::hasZ( type ) );

mRelativeMButton->setEnabled( QgsWkbTypes::hasM( type ) );
mMLabel->setEnabled( QgsWkbTypes::hasM( type ) );
mMLineEdit->setEnabled( QgsWkbTypes::hasM( type ) );
mLockMButton->setEnabled( QgsWkbTypes::hasM( type ) );
mRepeatingLockMButton->setEnabled( QgsWkbTypes::hasM( type ) );
}

mCurrentMapToolSupportsCad = true;

if ( mSessionActive && !isVisible() )
Expand Down

0 comments on commit 5dbc3f6

Please sign in to comment.