Skip to content
Permalink
Browse files
Disable Z/M parts when layer is not 3D or Measure
  • Loading branch information
lbartoletti authored and nyalldawson committed Sep 12, 2021
1 parent 5dbc3f6 commit 29d95c7614484ced294368c0f26609aa6b1e212a
@@ -214,7 +214,7 @@ Clear any cached previous clicks and helper lines
determines if CAD tools are enabled or if map tools behaves "nomally"
%End

void switchZM( );
void switchZM( void );
%Docstring
Determines if Z or M will be enabled.

@@ -317,7 +317,7 @@ void QgsAdvancedDigitizingDockWidget::setCadEnabled( bool enabled )
}


void QgsAdvancedDigitizingDockWidget::switchZM( )
void QgsAdvancedDigitizingDockWidget::switchZM( void )
{
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mMapCanvas->currentLayer() );
if ( vlayer )
@@ -1377,24 +1377,6 @@ 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() )
@@ -254,7 +254,7 @@ class GUI_EXPORT QgsAdvancedDigitizingDockWidget : public QgsDockWidget, private
* Determines if Z or M will be enabled.
* \since QgIS 3.20
*/
void switchZM( );
void switchZM( void );

//! construction mode is used to draw intermediate points. These points won't be given any further (i.e. to the map tools)
bool constructionMode() const { return mConstructionMode; }

0 comments on commit 29d95c7

Please sign in to comment.