mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Fix project retrieval for QgsReport
This commit is contained in:
parent
f4a99b65bb
commit
6db24327f2
@ -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 @@ class TestQgsReport(unittest.TestCase):
|
||||
r = QgsReport(p)
|
||||
|
||||
self.assertEqual(r.layoutProject(), p)
|
||||
self.assertEqual(r.project(), p)
|
||||
|
||||
r.setHeaderEnabled(True)
|
||||
self.assertTrue(r.headerEnabled())
|
||||
|
Loading…
x
Reference in New Issue
Block a user