Skip to content
Permalink
Browse files
Display an error when an auxiliary layer cannot be created
  • Loading branch information
pblottiere committed Jun 7, 2021
1 parent d290df2 commit eb7d465c42278cb2ebb79812c467e344e8c30868
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/gui/qgsnewauxiliarylayerdialog.cpp
@@ -46,13 +46,18 @@ void QgsNewAuxiliaryLayerDialog::accept()

if ( idx >= 0 )
{
QString errorMsg;
const QgsField field = mLayer->fields().field( idx );
QgsAuxiliaryLayer *alayer = QgsProject::instance()->auxiliaryStorage()->createAuxiliaryLayer( field, mLayer );
QgsAuxiliaryLayer *alayer = QgsProject::instance()->auxiliaryStorage()->createAuxiliaryLayer( field, mLayer, &errorMsg );

if ( alayer )
{
mLayer->setAuxiliaryLayer( alayer );
}
else
{
QMessageBox::critical( this, tr( "New Auxiliary Layer" ), errorMsg );
}
}

QDialog::accept();

0 comments on commit eb7d465

Please sign in to comment.