Skip to content
Permalink
Browse files

Disable ok button when no there's no field

  • Loading branch information
pblottiere authored and nyalldawson committed Oct 22, 2018
1 parent c94eefb commit 41f5abccaad238f4c90826ef9d2509a345ff1aa3
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/gui/qgsnewauxiliarylayerdialog.cpp
@@ -20,6 +20,7 @@
#include "qgsauxiliarystorage.h"

#include <QMessageBox>
#include <QPushButton>

QgsNewAuxiliaryLayerDialog::QgsNewAuxiliaryLayerDialog( QgsVectorLayer *layer, QWidget *parent )
: QDialog( parent )
@@ -30,6 +31,11 @@ QgsNewAuxiliaryLayerDialog::QgsNewAuxiliaryLayerDialog( QgsVectorLayer *layer, Q
const QgsFields fields = mLayer->fields();
for ( const QgsField &field : fields )
comboBox->addItem( field.name() );

if ( fields.isEmpty() )
{
buttonBox->button( QDialogButtonBox::Ok )->setDisabled( true );
}
}

void QgsNewAuxiliaryLayerDialog::accept()

0 comments on commit 41f5abc

Please sign in to comment.
You can’t perform that action at this time.