Skip to content
Permalink
Browse files
init zm support in QgsAdvancedDigitzingDockWidgetBase
  • Loading branch information
lbartoletti authored and nyalldawson committed Sep 12, 2021
1 parent c2897fa commit 5dbc3f648a7b966040046381727ce3e72c2d85bd
Showing with 18 additions and 1 deletion.
  1. +18 −1 src/gui/qgsadvanceddigitizingdockwidget.cpp
@@ -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();
@@ -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() )

0 comments on commit 5dbc3f6

Please sign in to comment.