Skip to content
Permalink
Browse files

Explicitly disable remove button if no child report section is selected

  • Loading branch information
nyalldawson committed Jan 5, 2018
1 parent 01ce9bc commit b184c5e102a523bbe7351d3cc091f5ff44852a2b
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/app/layout/qgsreportorganizerwidget.cpp
@@ -66,6 +66,7 @@ QgsReportOrganizerWidget::QgsReportOrganizerWidget( QWidget *parent, QgsLayoutDe

mButtonAddSection->setMenu( addMenu );
connect( mButtonRemoveSection, &QPushButton::clicked, this, &QgsReportOrganizerWidget::removeSection );
mButtonRemoveSection->setEnabled( false ); //disable until section clicked
}

void QgsReportOrganizerWidget::setMessageBar( QgsMessageBar *bar )
@@ -112,6 +113,9 @@ void QgsReportOrganizerWidget::selectionChanged( const QModelIndex &current, con
if ( !parent )
parent = mReport;

// report cannot be deleted
mButtonRemoveSection->setEnabled( parent != mReport );

delete mConfigWidget;
if ( QgsReportSectionLayout *section = dynamic_cast< QgsReportSectionLayout * >( parent ) )
{

0 comments on commit b184c5e

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