Skip to content
Permalink
Browse files

Fix project retrieval for QgsReport

  • Loading branch information
nyalldawson committed Dec 30, 2017
1 parent f4a99b6 commit 6db24327f2ec12d27c435b45da49b2fefd5ee1c5
Showing with 4 additions and 0 deletions.
  1. +3 −0 src/core/layout/qgsabstractreportsection.cpp
  2. +1 −0 tests/src/python/test_qgsreport.py
@@ -33,6 +33,9 @@ QgsAbstractReportSection::~QgsAbstractReportSection()

QgsProject *QgsAbstractReportSection::project()
{
if ( QgsReport *report = dynamic_cast< QgsReport * >( this ) )
return report->layoutProject();

QgsAbstractReportSection *current = this;
while ( QgsAbstractReportSection *parent = current->parentSection() )
{
@@ -37,6 +37,7 @@ def testGettersSetters(self):
r = QgsReport(p)

self.assertEqual(r.layoutProject(), p)
self.assertEqual(r.project(), p)

r.setHeaderEnabled(True)
self.assertTrue(r.headerEnabled())

0 comments on commit 6db2432

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