Skip to content

Commit 41f5abc

Browse files
pblottierenyalldawson
authored andcommitted
Disable ok button when no there's no field
1 parent c94eefb commit 41f5abc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/gui/qgsnewauxiliarylayerdialog.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "qgsauxiliarystorage.h"
2121

2222
#include <QMessageBox>
23+
#include <QPushButton>
2324

2425
QgsNewAuxiliaryLayerDialog::QgsNewAuxiliaryLayerDialog( QgsVectorLayer *layer, QWidget *parent )
2526
: QDialog( parent )
@@ -30,6 +31,11 @@ QgsNewAuxiliaryLayerDialog::QgsNewAuxiliaryLayerDialog( QgsVectorLayer *layer, Q
3031
const QgsFields fields = mLayer->fields();
3132
for ( const QgsField &field : fields )
3233
comboBox->addItem( field.name() );
34+
35+
if ( fields.isEmpty() )
36+
{
37+
buttonBox->button( QDialogButtonBox::Ok )->setDisabled( true );
38+
}
3339
}
3440

3541
void QgsNewAuxiliaryLayerDialog::accept()

0 commit comments

Comments
 (0)