mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-05 00:09:32 -04:00
Display an error when an auxiliary layer cannot be created
This commit is contained in:
parent
d290df292f
commit
eb7d465c42
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user