Skip to content

Commit b184c5e

Browse files
committed
Explicitly disable remove button if no child report section is selected
1 parent 01ce9bc commit b184c5e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/app/layout/qgsreportorganizerwidget.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ QgsReportOrganizerWidget::QgsReportOrganizerWidget( QWidget *parent, QgsLayoutDe
6666

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

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

116+
// report cannot be deleted
117+
mButtonRemoveSection->setEnabled( parent != mReport );
118+
115119
delete mConfigWidget;
116120
if ( QgsReportSectionLayout *section = dynamic_cast< QgsReportSectionLayout * >( parent ) )
117121
{

0 commit comments

Comments
 (0)